Changeset 42378 for trunk/psLib
- Timestamp:
- Feb 8, 2023, 11:51:50 AM (3 years ago)
- Location:
- trunk/psLib
- Files:
-
- 6 edited
-
. (modified) (1 prop)
-
configure.ac (modified) (11 diffs)
-
src/db/psDB.c (modified) (6 diffs)
-
src/sys/psString.c (modified) (1 diff)
-
src/sys/psString.h (modified) (1 diff)
-
src/sys/psTrace.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib
- Property svn:mergeinfo changed
/branches/eam_branches/ipp-20220316/psLib (added) merged: 42117-42118,42153,42346,42353-42354,42368
- Property svn:mergeinfo changed
-
trunk/psLib/configure.ac
r34089 r42378 46 46 SRCDIRS="sys astro db fft fits imageops jpeg math mathtypes types" dnl xml 47 47 # escape two escapes at this level so \\ gets passed to the shell and \ to perl 48 SRCINC=`echo "${SRCDIRS =}" | ${PERL} -pe "s|(\w+)|-I\\\\${SRCPATH=}/\1|g"`49 SRCINC="-I${SRCPATH =} ${SRCINC=}"50 SRCSUBLIBS=`echo "${SRCDIRS =}" | ${PERL} -pe "s|(\w+)|\1/libpslib\1.la|g"`51 AC_SUBST(SRCSUBLIBS,${SRCSUBLIBS =})52 AC_SUBST(SRCINC,${SRCINC =})48 SRCINC=`echo "${SRCDIRS}" | ${PERL} -pe "s|(\w+)|-I\\\\${SRCPATH}/\1|g"` 49 SRCINC="-I${SRCPATH} ${SRCINC}" 50 SRCSUBLIBS=`echo "${SRCDIRS}" | ${PERL} -pe "s|(\w+)|\1/libpslib\1.la|g"` 51 AC_SUBST(SRCSUBLIBS,${SRCSUBLIBS}) 52 AC_SUBST(SRCINC,${SRCINC}) 53 53 AC_SUBST(ABS_SRCDIR,`pwd`) dnl assuming configure is run in top directory -- is there something better? 54 54 AC_PROG_MAKE_SET … … 67 67 [AC_MSG_RESULT(memory allocation backtracing enabled) 68 68 AC_DEFINE([PS_MEM_BACKTRACE], 1, [Define to 1 if you want memory backtracing]) 69 CFLAGS="${CFLAGS =} -rdynamic"69 CFLAGS="${CFLAGS} -rdynamic" 70 70 ] 71 71 ) … … 102 102 103 103 ACX_PTHREAD( 104 [PSLIB_CFLAGS="${PSLIB_CFLAGS =} ${PTHREAD_CFLAGS}"105 PSLIB_LIBS="${PSLIB_LIBS =} ${PTHREAD_CFLAGS} ${PTHREAD_LIBS}"],104 [PSLIB_CFLAGS="${PSLIB_CFLAGS} ${PTHREAD_CFLAGS}" 105 PSLIB_LIBS="${PSLIB_LIBS} ${PTHREAD_CFLAGS} ${PTHREAD_LIBS}"], 106 106 [AC_MSG_ERROR([pthread support is required to build psLib])] 107 107 ) … … 110 110 111 111 AX_LIB_MYSQL([4.1.2], 112 [PSLIB_CFLAGS="${PSLIB_CFLAGS =} ${MYSQL_CFLAGS} -DHAVE_PSDB"113 PSLIB_LIBS="${PSLIB_LIBS =} ${MYSQL_LDFLAGS}"],114 [PSLIB_CFLAGS="${PSLIB_CFLAGS =}"]112 [PSLIB_CFLAGS="${PSLIB_CFLAGS} ${MYSQL_CFLAGS} -DHAVE_PSDB" 113 PSLIB_LIBS="${PSLIB_LIBS} ${MYSQL_LDFLAGS}"], 114 [PSLIB_CFLAGS="${PSLIB_CFLAGS}"] 115 115 ) 116 116 … … 125 125 PKG_CHECK_MODULES([CFITSIO], [cfitsio], [], AC_MSG_ERROR([CFITSIO package not found. Obtain CFITSIO at http://heasarc.gsfc.nasa.gov/docs/software/fitsio])) 126 126 127 PSLIB_CFLAGS="${PSLIB_CFLAGS =} ${CFITSIO_CFLAGS}"128 PSLIB_LIBS="${PSLIB_LIBS =} ${CFITSIO_LIBS}"129 130 CFLAGS="${CFLAGS =} ${CFITSIO_CFLAGS}"131 LDFLAGS="${LDFLAGS =} ${CFITSIO_LIBS}"127 PSLIB_CFLAGS="${PSLIB_CFLAGS} ${CFITSIO_CFLAGS}" 128 PSLIB_LIBS="${PSLIB_LIBS} ${CFITSIO_LIBS}" 129 130 CFLAGS="${CFLAGS} ${CFITSIO_CFLAGS}" 131 LDFLAGS="${LDFLAGS} ${CFITSIO_LIBS}" 132 132 133 133 dnl Now check if CFITSIO supports fits_open_diskfile, i.e., is at least version 2.501 … … 159 159 PKG_CHECK_MODULES([FFTW3], [fftw3f], [], AC_MSG_ERROR([FFTW version 3 (--enable-float) library not found. Obtain it at http://www.fftw.org/])) 160 160 161 PSLIB_CFLAGS="${PSLIB_CFLAGS =} ${FFTW3_CFLAGS}"162 PSLIB_LIBS="${PSLIB_LIBS =} ${FFTW3_LIBS}"161 PSLIB_CFLAGS="${PSLIB_CFLAGS} ${FFTW3_CFLAGS}" 162 PSLIB_LIBS="${PSLIB_LIBS} ${FFTW3_LIBS}" 163 163 164 164 CFLAGS="${CFLAGS} ${FFTW3_CFLAGS}" … … 190 190 PKG_CHECK_MODULES([GSL], [gsl], [], AC_MSG_ERROR([GSL is required. Obtain it at http://www.gnu.org/software/gsl])) 191 191 192 PSLIB_CFLAGS="${PSLIB_CFLAGS =} ${GSL_CFLAGS}"193 PSLIB_LIBS="${PSLIB_LIBS =} ${GSL_LIBS}"192 PSLIB_CFLAGS="${PSLIB_CFLAGS} ${GSL_CFLAGS}" 193 PSLIB_LIBS="${PSLIB_LIBS} ${GSL_LIBS}" 194 194 195 195 AC_SUBST([GSL_CFLAGS]) … … 303 303 LDFLAGS="${LDFLAGS} ${JPEG_LDFLAGS}" 304 304 305 AC_CHECK_HEADERS([jpeglib.h],[PSLIB_CFLAGS="${PSLIB_CFLAGS =} ${JPEG_CFLAGS}"305 AC_CHECK_HEADERS([jpeglib.h],[PSLIB_CFLAGS="${PSLIB_CFLAGS} ${JPEG_CFLAGS}" 306 306 AC_SUBST(JPEG_CFLAGS)], 307 307 [AC_MSG_ERROR([libjpeg headers not found. Obtain libjpeg from http://www.ijg.org/ or use --with-jpeg to specify location.])] 308 308 ) 309 309 310 AC_CHECK_LIB(jpeg,jpeg_CreateCompress,[PSLIB_LIBS="${PSLIB_LIBS =} ${JPEG_LDFLAGS} -ljpeg"],310 AC_CHECK_LIB(jpeg,jpeg_CreateCompress,[PSLIB_LIBS="${PSLIB_LIBS} ${JPEG_LDFLAGS} -ljpeg"], 311 311 [AC_MSG_ERROR([libjpeg library not found. Obtain libjpeg from http://www.ijg.org/ or use --with-jpeg to specify location.])] 312 312 ) … … 391 391 AC_CHECK_FILE($SWIG,[], 392 392 [AC_MSG_ERROR([SWIG is required. Obtain it at www.swig.org or use --with-swig to specify its install location.])]) 393 SUBDIR="${SUBDIR =} swig"393 SUBDIR="${SUBDIR} swig" 394 394 395 395 dnl restore the CFLAGS/LDFLAGS … … 433 433 434 434 AC_CHECK_LIB(mx,sqrtf, 435 [PSLIB_LIBS="${PSLIB_LIBS =} -lmx"])435 [PSLIB_LIBS="${PSLIB_LIBS} -lmx"]) 436 436 LIBS=${TMP_LIBS} 437 437 AC_CHECK_FUNC(atoll, [], … … 474 474 IPP_STDOPTS 475 475 IPP_STDCFLAGS 476 CFLAGS="${CFLAGS =} -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=200112L"476 CFLAGS="${CFLAGS} -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=200112L" 477 477 478 478 dnl ---------------- export variables -------------------- -
trunk/psLib/src/db/psDB.c
r41896 r42378 56 56 57 57 58 # if (MYSQL_VERSION_ID >= 80000) 59 # define MYSQL_BOOL bool 60 # else 61 # define MYSQL_BOOL my_bool 62 # endif 63 58 64 // set the pointer to NULL if we are actually freeing the memory 59 65 #define PSDB_NULL_FREE(ptr) \ … … 138 144 139 145 // pType utility functions 140 static psPtr psDBGetPTypeNaN(psElemType pType);141 static boolpsDBIsPTypeNaN(psElemType pType, psPtr data);146 static psPtr psDBGetPTypeNaN(psElemType pType); 147 static MYSQL_BOOL psDBIsPTypeNaN(psElemType pType, psPtr data); 142 148 143 149 // public functions … … 753 759 // the return value also needs to be inverted for the same reason. 754 760 // is it safe to assume my_bool always safely casts to bool? 761 // XXX EAM 2022.03.15 : at least in mysql 8.0.28, my_bool is gone and just bool is used 762 // in 5.0 and 5.6, my_bool is char 763 // 755 764 return !(bool)mysql_autocommit(dbh->mysql, !mode); 756 765 } … … 1447 1456 1448 1457 mysqlType *mType; // type tmp variable 1449 static my_bool isNull = true; // used in a MYSQL_BIND to indicate NULL 1458 1459 // XXX EAM 2022.03.15 : at least in mysql 8.0.28, my_bool is gone and just bool is used 1460 // in 5.0 and 5.6, my_bool is char 1461 static MYSQL_BOOL isNull = true; // used in a MYSQL_BIND to indicate NULL 1450 1462 1451 1463 MYSQL_BIND *bind = mysqlRow->bind; … … 1602 1614 // assume for the time being that we don't have negative 1603 1615 // time as ISO8601 doesn't support dates prior to 0 1604 myTime->neg = (my_bool)false; 1616 // XXX EAM 2022.03.15 : at least in mysql 8.0.28, my_bool is gone and just bool is used 1617 // in 5.0 and 5.6, my_bool is char 1618 myTime->neg = (bool)false; 1605 1619 // currently unused by mysql 1606 1620 myTime->second_part = (unsigned long)time->nsec; … … 2869 2883 #define PS_IS_NAN(type, data, nan) *(type *)data == nan 2870 2884 2871 static bool psDBIsPTypeNaN(psElemType pType,2872 psPtr data) 2885 static MYSQL_BOOL psDBIsPTypeNaN(psElemType pType, psPtr data) 2886 2873 2887 { 2874 2888 bool isNaN = NULL; -
trunk/psLib/src/sys/psString.c
r41171 r42378 41 41 42 42 43 // gcc (Ubuntu 20.04) complains when strncpy is used to copy a fraction of a buffer, 44 // potentially skipping the ending NULL. To avoid the error, manually copy 45 // and (to ensure the buffer ends in a NULL) set the last + 1 byte to NUL: 46 // WARNING : len(dest) must be >= n + 1 47 char *ps_strncpy_nowarn (char *dest, const char *src, size_t n) { 48 49 size_t i; 50 51 char *d = dest; 52 char *s = (char *) src; 53 for (i = 0; i < n && *s != 0; i++, d++, s++) { *d = *s; } 54 for ( ; i <= n; i++, d++) { *d = 0; } 55 56 return dest; 57 } 58 43 59 psString p_psStringAlloc(const char *file, 44 60 unsigned int lineno, -
trunk/psLib/src/sys/psString.h
r40551 r42378 48 48 void psNOOP (void); 49 49 50 char *ps_strncpy_nowarn (char *dest, const char *src, size_t n); 51 50 52 // some constants to use in snprintf statements and variable definitions to ensure 51 53 // consistency -
trunk/psLib/src/sys/psTrace.c
r26892 r42378 213 213 } 214 214 215 strncpy(name, addNodeName, MAX_COMPONENT_LENGTH);215 ps_strncpy_nowarn(name, addNodeName, MAX_COMPONENT_LENGTH); 216 216 char *pname = name+1; // Take off the period 217 217 // Iterate through the components of addNodeName. Strip off the first
Note:
See TracChangeset
for help on using the changeset viewer.
