Merged changes from 3.14 branch.

Merged up to commit 12364 (2012-09-11) inclusive.
This commit is contained in:
Andrew Johnson
2012-10-01 00:54:10 -05:00
8 changed files with 54 additions and 48 deletions

View File

@@ -10,13 +10,15 @@
# i386
# x86_64 - Needs MacOS 10.4 with the Universal SDK, or 10.5 and later
ARCH_CLASS = i386
#ARCH_CLASS = x86_64
#ARCH_CLASS = i386
ARCH_CLASS = x86_64
#ARCH_CLASS = i386 x86_64
# Uncomment the followings lines to build with CLANG instead of GCC.
#
#GNU = NO
#CMPLR_CLASS = clang
#CC = clang
#CCC = clang++
# Comment out the following lines to build with GCC instead of CLANG.
#
CMPLR_CLASS = clang
CC = clang
CCC = clang++
GNU = NO

View File

@@ -494,12 +494,12 @@ int main (int argc, char *argv[])
if (charArrAsStr) {
count = len;
dbrType = DBR_CHAR;
ebuf = calloc(strlen(cbuf), sizeof(char));
ebuf = calloc(strlen(cbuf)+1, sizeof(char));
if(!ebuf) {
fprintf(stderr, "Memory allocation failed\n");
return 1;
}
epicsStrnRawFromEscaped(ebuf, strlen(cbuf), cbuf, strlen(cbuf));
epicsStrnRawFromEscaped(ebuf, strlen(cbuf)+1, cbuf, strlen(cbuf));
} else {
for (i = 0; i < count; ++i) {
epicsStrnRawFromEscaped(sbuf[i], sizeof(EpicsStr), *(argv+optind+i), sizeof(EpicsStr));

View File

@@ -445,10 +445,15 @@ char *dbr2str (const void *value, unsigned type)
\
if (charArrAsStr && dbr_type_is_CHAR(TYPE_ENUM) && (reqElems || pv->nElems > 1)) { \
dbr_char_t *s = (dbr_char_t*) dbr_value_ptr(pv->value, pv->dbrType); \
int dlen = epicsStrnEscapedFromRawSize((char*)s, strlen((char*)s)); \
char *d = calloc(dlen+1, sizeof(char)); \
size_t len = strlen((char*)s); \
unsigned long elems = reqElems && (reqElems < pv->nElems) ? reqElems : pv->nElems; \
int dlen; \
char *d; \
if (len < elems) elems = len; \
dlen = epicsStrnEscapedFromRawSize((char*)s, elems); \
d = calloc(dlen+1, sizeof(char)); \
if(d) { \
epicsStrnEscapedFromRaw(d, dlen+1, (char*)s, strlen((char*)s));\
epicsStrnEscapedFromRaw(d, dlen+1, (char*)s, elems); \
printf("%c%s", fieldSeparator, d); \
free(d); \
} else { \

View File

@@ -1,12 +1,10 @@
/* share/src/as/asDbLib.c */
/*************************************************************************\
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* Copyright (c) 2012 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* Author: Marty Kraimer Date: 02-11-94*/
@@ -69,18 +67,23 @@ static long asDbAddRecords(void)
int asSetFilename(const char *acf)
{
if(pacf) free ((void *)pacf);
if(acf) {
pacf = calloc(1,strlen(acf)+1);
if(!pacf) {
errMessage(0,"asSetFilename calloc failure");
} else {
strcpy(pacf,acf);
}
if (pacf)
free (pacf);
if (acf) {
pacf = calloc(1, strlen(acf)+1);
if (!pacf) {
errMessage(0, "asSetFilename calloc failure");
} else {
strcpy(pacf, acf);
if (*pacf != '/' && !strchr(pacf, ':')) {
printf("asSetFilename: Warning - relative paths won't usually "
"work\n");
}
}
} else {
pacf = NULL;
pacf = NULL;
}
return(0);
return 0;
}
int asSetSubstitutions(const char *substitutions)

View File

@@ -11,6 +11,11 @@
#include <stdio.h>
#include <stdarg.h>
#ifndef _MSC_VER
/* Older versions of MinGW omitted this prototype from stdio.h */
_CRTIMP int __cdecl __MINGW_NOTHROW _vscprintf (const char*, va_list);
#endif
#define epicsExportSharedSymbols
#include "epicsStdio.h"
@@ -18,26 +23,12 @@ int epicsShareAPI epicsVsnprintf(char *str, size_t len,
const char *fmt, va_list ap)
{
int retval = _vsnprintf(str, len, fmt, ap);
#ifdef _MSC_VER
int needed = _vscprintf(fmt, ap);
if ((int) len < needed + 1) {
str[len - 1] = 0;
return needed;
}
#else
/* Unfortunately MINGW doesn't provide _vscprintf and their
* _vsnprintf follows MS' broken return value semantics.
*/
if (retval == -1) {
if (len)
str[len - 1] = 0;
return len;
} else if (retval == (int) len) {
str[--retval] = 0;
}
#endif
return retval;
}

View File

@@ -189,8 +189,12 @@ epicsReadlineEnd (void *context)
#include <ledLib.h>
#define LEDLIB_LINESIZE 1000
#ifndef _WRS_VXWORKS_MAJOR
typedef int LED_ID;
#endif
struct readlineContext {
int ledId;
LED_ID ledId;
char line[LEDLIB_LINESIZE];
FILE *in;
};
@@ -205,7 +209,7 @@ epicsReadlineBegin(FILE *in)
readlineContext = malloc(sizeof *readlineContext);
if (readlineContext != NULL) {
readlineContext->ledId = ERROR;
readlineContext->ledId = (LED_ID) ERROR;
readlineContext->in = in;
if (in == NULL) {
long i = 50;
@@ -213,7 +217,7 @@ epicsReadlineBegin(FILE *in)
envGetLongConfigParam(&IOCSH_HISTSIZE, &i);
if (i < 1) i = 1;
readlineContext->ledId = ledOpen(fileno(stdin), fileno(stdout), i);
if (readlineContext->ledId == ERROR) {
if (readlineContext->ledId == (LED_ID) ERROR) {
readlineContext->in = stdin;
printf("Warning -- Unabled to allocate space for command-line history.\n");
printf("Warning -- Command-line editting disabled.\n");
@@ -236,7 +240,7 @@ epicsReadline (const char *prompt, void *context)
fputs(prompt, stdout);
fflush(stdout);
}
if (readlineContext->ledId != ERROR) {
if (readlineContext->ledId != (LED_ID) ERROR) {
i = ledRead(readlineContext->ledId, readlineContext->line, LEDLIB_LINESIZE-1);
if (i < 0)
return NULL;
@@ -262,7 +266,7 @@ epicsReadlineEnd (void *context)
struct readlineContext *readlineContext = context;
if (readlineContext) {
if (readlineContext->ledId != ERROR)
if (readlineContext->ledId != (LED_ID) ERROR)
ledClose(readlineContext->ledId);
free(readlineContext);
}

View File

@@ -28,9 +28,9 @@ PYTHON_INCLUDE=/System/Library/Frameworks/Python.framework/Versions/2.3/include/
# XDarwin
#
X11_LIB=/usr/X11R6/lib
X11_INC=/usr/X11R6/include/X11
X11_INC=/usr/X11R6/include
XPM_LIB=/usr/X11R6/lib
XPM_INC=/usr/X11R6/include/X11
XPM_INC=/usr/X11R6/include
#
# Fink OpenMotif

View File

@@ -123,6 +123,7 @@ sub AbsPath {
# Now calculate the absolute path
my $abs = File::Spec->rel2abs($path, abs_path($cwd));
$abs = abs_path($abs) if -e $abs;
return LocalPath($abs);
}