commit gtkwave for openSUSE:Factory
Hello community, here is the log from the commit of package gtkwave for openSUSE:Factory checked in at 2014-04-29 17:33:19 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/gtkwave (Old) and /work/SRC/openSUSE:Factory/.gtkwave.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "gtkwave" Changes: -------- --- /work/SRC/openSUSE:Factory/gtkwave/gtkwave.changes 2014-03-22 09:07:09.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.gtkwave.new/gtkwave.changes 2014-04-29 17:33:20.000000000 +0200 @@ -1,0 +2,10 @@ +Tue Apr 29 10:17:50 UTC 2014 - dmitry_r@opensuse.org + +- Update to version 3.3.59 + * Use Duff's Device for 8 byte -> 1 byte binary value compression + algorithm in FST writer. + * Updated man page for gtkwave.1 indicating that XID is in hex. + * Allow decimal conversions on popcnt filtered vectors that are + greater than 64 bits (they will never overflow). + +------------------------------------------------------------------- Old: ---- gtkwave-3.3.58.tar.gz New: ---- gtkwave-3.3.59.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ gtkwave.spec ++++++ --- /var/tmp/diff_new_pack.KEvM1z/_old 2014-04-29 17:33:21.000000000 +0200 +++ /var/tmp/diff_new_pack.KEvM1z/_new 2014-04-29 17:33:21.000000000 +0200 @@ -17,7 +17,7 @@ Name: gtkwave -Version: 3.3.58 +Version: 3.3.59 Release: 0 Summary: Waveform viewer for Ditital Signals License: GPL-2.0+ ++++++ gtkwave-3.3.58.tar.gz -> gtkwave-3.3.59.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gtkwave-3.3.58/ChangeLog new/gtkwave-3.3.59/ChangeLog --- old/gtkwave-3.3.58/ChangeLog 2014-03-16 06:31:40.000000000 +0100 +++ new/gtkwave-3.3.59/ChangeLog 2014-04-26 19:55:01.000000000 +0200 @@ -1461,3 +1461,13 @@ Change [1] at end of struct to C99 [] notation with appropriate allocation size modification. System_profiler speed fix for OSX. +3.3.59 26apr14 Use Duff's Device for 8 byte -> 1 byte binary value compression + algorithm in FST writer. + Warnings fixes from cppcheck. + Moved MinGW for FST to using different windows tempfile + generation instead of tmpfile(). + Removed fflush() in FST for MinGW in places that can cause + crashes with read only files. + Updated man page for gtkwave.1 indicating that XID is in hex. + Allow decimal conversions on popcnt filtered vectors that are + greater than 64 bits (they will never overflow). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gtkwave-3.3.58/LICENSE.TXT new/gtkwave-3.3.59/LICENSE.TXT --- old/gtkwave-3.3.58/LICENSE.TXT 2014-02-14 21:26:10.000000000 +0100 +++ new/gtkwave-3.3.59/LICENSE.TXT 2014-03-21 19:23:34.000000000 +0100 @@ -1,6 +1,6 @@ ########################################################################## -GTKWave 3.3.58 Wave Viewer is Copyright (C) 1999-2014 Tony Bybell. +GTKWave 3.3.59 Wave Viewer is Copyright (C) 1999-2014 Tony Bybell. Portions of GTKWave are Copyright (C) 1999-2014 Udi Finkelstein. Context support is Copyright (C) 2007-2014 Kermin Elliott Fleming. Trace group support is Copyright (C) 2009-2014 Donald Baltus. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gtkwave-3.3.58/configure new/gtkwave-3.3.59/configure --- old/gtkwave-3.3.58/configure 2014-02-14 21:26:10.000000000 +0100 +++ new/gtkwave-3.3.59/configure 2014-03-21 19:23:34.000000000 +0100 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for gtkwave 3.3.58. +# Generated by GNU Autoconf 2.69 for gtkwave 3.3.59. # # Report bugs to <bybell@rocketmail.com>. # @@ -580,8 +580,8 @@ # Identity of this package. PACKAGE_NAME='gtkwave' PACKAGE_TARNAME='gtkwave' -PACKAGE_VERSION='3.3.58' -PACKAGE_STRING='gtkwave 3.3.58' +PACKAGE_VERSION='3.3.59' +PACKAGE_STRING='gtkwave 3.3.59' PACKAGE_BUGREPORT='bybell@rocketmail.com' PACKAGE_URL='' @@ -1382,7 +1382,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures gtkwave 3.3.58 to adapt to many kinds of systems. +\`configure' configures gtkwave 3.3.59 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1448,7 +1448,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of gtkwave 3.3.58:";; + short | recursive ) echo "Configuration of gtkwave 3.3.59:";; esac cat <<\_ACEOF @@ -1593,7 +1593,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -gtkwave configure 3.3.58 +gtkwave configure 3.3.59 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2237,7 +2237,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by gtkwave $as_me 3.3.58, which was +It was created by gtkwave $as_me 3.3.59, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3104,7 +3104,7 @@ # Define the identity of the package. PACKAGE='gtkwave' - VERSION='3.3.58' + VERSION='3.3.59' cat >>confdefs.h <<_ACEOF @@ -10959,7 +10959,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by gtkwave $as_me 3.3.58, which was +This file was extended by gtkwave $as_me 3.3.59, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -11025,7 +11025,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -gtkwave config.status 3.3.58 +gtkwave config.status 3.3.59 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gtkwave-3.3.58/configure.ac new/gtkwave-3.3.59/configure.ac --- old/gtkwave-3.3.58/configure.ac 2014-02-14 21:26:10.000000000 +0100 +++ new/gtkwave-3.3.59/configure.ac 2014-03-21 19:23:34.000000000 +0100 @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) -AC_INIT(gtkwave, 3.3.58, bybell@rocketmail.com) +AC_INIT(gtkwave, 3.3.59, bybell@rocketmail.com) AC_CONFIG_SRCDIR([src/vcd.c]) AM_INIT_AUTOMAKE AC_CONFIG_HEADER([config.h]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gtkwave-3.3.58/contrib/bundle_for_osx/Info-gtkwave.plist new/gtkwave-3.3.59/contrib/bundle_for_osx/Info-gtkwave.plist --- old/gtkwave-3.3.58/contrib/bundle_for_osx/Info-gtkwave.plist 2014-02-14 21:26:10.000000000 +0100 +++ new/gtkwave-3.3.59/contrib/bundle_for_osx/Info-gtkwave.plist 2014-03-21 19:23:34.000000000 +0100 @@ -8,7 +8,7 @@ <key>CFBundleExecutable</key> <string>gtkwave</string> <key>CFBundleGetInfoString</key> - <string>3.3.58, (C) 1999-2014 Tony Bybell http://gtkwave.sourceforge.net</string> + <string>3.3.59, (C) 1999-2014 Tony Bybell http://gtkwave.sourceforge.net</string> <key>CFBundleIconFile</key> <string>gtkwave.icns</string> <key>CFBundleIdentifier</key> @@ -18,11 +18,11 @@ <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> - <string>3.3.58</string> + <string>3.3.59</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleVersion</key> - <string>3.3.58</string> + <string>3.3.59</string> <key>NSHumanReadableCopyright</key> <string>Copyright 1999 - 2014 Tony Bybell, GNU General Public License.</string> <key>LSMinimumSystemVersion</key> Files old/gtkwave-3.3.58/doc/gtkwave.odt and new/gtkwave-3.3.59/doc/gtkwave.odt differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gtkwave-3.3.58/man/gtkwave.1 new/gtkwave-3.3.59/man/gtkwave.1 --- old/gtkwave-3.3.58/man/gtkwave.1 2012-03-24 20:47:01.000000000 +0100 +++ new/gtkwave-3.3.59/man/gtkwave.1 2014-04-22 15:05:17.000000000 +0200 @@ -1,4 +1,4 @@ -.TH "GTKWAVE" "1" "3.3.29" "Anthony Bybell" "Simulation Wave Viewer" +.TH "GTKWAVE" "1" "3.3.59" "Anthony Bybell" "Simulation Wave Viewer" .SH "NAME" .LP gtkwave \- Visualization tool for VCD, LXT, LXT2, VZT, FST, and GHW files @@ -94,7 +94,7 @@ Specifies delay in milliseconds between successive executions of the repscript. Default is 500. .TP \fB\-X\fR,\fB\-\-xid\fR <\fIXID\fP> -Specify XID of window for a GtkPlug to connect to. GTKWave does not directly render to a window but instead renders into a +Specify XID (in hexadecimal) of window for a GtkPlug to connect to. GTKWave does not directly render to a window but instead renders into a GtkPlug expecting a GtkSocket at the other end. Note that there are issues with accelerators working properly so menus are disabled in the componentized version of GTKWave when it functions as a plug-in. .TP diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gtkwave-3.3.58/src/baseconvert.c new/gtkwave-3.3.59/src/baseconvert.c --- old/gtkwave-3.3.58/src/baseconvert.c 2014-02-25 22:36:14.000000000 +0100 +++ new/gtkwave-3.3.59/src/baseconvert.c 2014-04-26 19:55:01.000000000 +0200 @@ -330,7 +330,7 @@ if(GLOBALS->show_base) { *(pnt++)='"'; } *(pnt)=0x00; /* scan build : remove dead increment */ } -else if((flags&TR_HEX)||((flags&(TR_DEC|TR_SIGNED))&&(nbits>64))) +else if((flags&TR_HEX)||((flags&(TR_DEC|TR_SIGNED))&&(nbits>64)&&(!(flags&TR_POPCNT)))) { char *parse; @@ -990,7 +990,7 @@ if(GLOBALS->show_base) { *(pnt++)='"'; } *(pnt)=0x00; /* scan build : remove dead increment */ } -else if((flags&TR_HEX)||((flags&(TR_DEC|TR_SIGNED))&&(nbits>64))) +else if((flags&TR_HEX)||((flags&(TR_DEC|TR_SIGNED))&&(nbits>64)&&(!(flags&TR_POPCNT)))) { char *parse; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gtkwave-3.3.58/src/file.c new/gtkwave-3.3.59/src/file.c --- old/gtkwave-3.3.58/src/file.c 2013-10-31 03:43:36.000000000 +0100 +++ new/gtkwave-3.3.59/src/file.c 2014-04-11 01:23:04.000000000 +0200 @@ -174,7 +174,7 @@ } else { - sprintf(lpstrFilter, "%s%c%s%c%s%c%s%c", pattn, 0, pattn, 0, "All", 0, "*.*"); + sprintf(lpstrFilter, "%s%c%s%c%s%c%s%c", pattn, 0, pattn, 0, "All", 0, "*.*", 0); /* cppcheck */ ofn.nFilterIndex = 0; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gtkwave-3.3.58/src/ghwlib.c new/gtkwave-3.3.59/src/ghwlib.c --- old/gtkwave-3.3.58/src/ghwlib.c 2014-03-02 00:05:21.000000000 +0100 +++ new/gtkwave-3.3.59/src/ghwlib.c 2014-04-11 01:23:04.000000000 +0200 @@ -524,7 +524,10 @@ e->wkt = ghw_wkt_unknown; e->name = ghw_read_strid (h); if (ghw_read_uleb128 (h, (uint32_t *)&e->nbr) != 0) - return -1; + { + free(e); /* cppcheck */ + return -1; + } e->lits = (const char **) calloc (1, e->nbr * sizeof (char *)); if (h->flag_verbose > 1) printf ("enum %s:", e->name); @@ -568,13 +571,20 @@ int ix; if (ghw_read_uleb128 (h, &ph->nbr_units) != 0) - return -1; + { + free(ph); /* cppcheck */ + return -1; + } ph->units = calloc (ph->nbr_units, sizeof (struct ghw_unit)); for (ix = 0; ix < ph->nbr_units; ix++) { ph->units[ix].name = ghw_read_strid (h); if (ghw_read_lsleb128 (h, &ph->units[ix].val) < 0) - return -1; + { + free(ph->units); /* missed by cppcheck */ + free(ph); /* missed by cppcheck */ + return -1; + } } } if (h->flag_verbose > 1) @@ -606,7 +616,10 @@ arr->name = ghw_read_strid (h); arr->el = ghw_read_typeid (h); if (ghw_read_uleb128 (h, (uint32_t *)&arr->nbr_dim) != 0) - return -1; + { + free(arr); /* cppcheck */ + return -1; + } arr->dims = (union ghw_type **) calloc (arr->nbr_dim, sizeof (union ghw_type *)); for (j = 0; j < arr->nbr_dim; j++) @@ -650,7 +663,10 @@ rec->kind = t; rec->name = ghw_read_strid (h); if (ghw_read_uleb128 (h, (uint32_t *)&rec->nbr_fields) != 0) - return -1; + { + free(rec); /* cppcheck */ + return -1; + } rec->el = calloc (rec->nbr_fields, sizeof (struct ghw_record_element)); nbr_el = 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gtkwave-3.3.58/src/helpers/fst/fstapi.c new/gtkwave-3.3.59/src/helpers/fst/fstapi.c --- old/gtkwave-3.3.58/src/helpers/fst/fstapi.c 2014-03-18 23:26:22.000000000 +0100 +++ new/gtkwave-3.3.59/src/helpers/fst/fstapi.c 2014-04-21 08:21:59.000000000 +0200 @@ -26,6 +26,7 @@ * FST_DYNAMIC_ALIAS_DISABLE : dynamic aliases are not processed * FST_DYNAMIC_ALIAS2_DISABLE : new encoding for dynamic aliases is not generated * FST_WRITEX_DISABLE : fast write I/O routines are disabled + * FST_DISABLE_DUFFS_DEVICE : only if indirect branches are incredibly bad on host arch * * possible enables: * @@ -51,6 +52,10 @@ #include <pthread.h> #endif +#ifdef __MINGW32__ +#include <windows.h> +#endif + #if HAVE_ALLOCA_H #include <alloca.h> #elif defined(__GNUC__) @@ -139,8 +144,14 @@ #endif #endif - -/* the recoded "extra" values... */ +/* + * the recoded "extra" values... + * note that FST_RCV_Q is currently unused and is for future expansion. + * its intended use is as another level of escape such that any arbitrary + * value can be stored as the value: { time_delta, 8 bits, FST_RCV_Q }. + * this is currently not implemented so that the branchless decode is: + * uint32_t shcnt = 2 << (vli & 1); tdelta = vli >> shcnt; + */ #define FST_RCV_X (1 | (0<<1)) #define FST_RCV_Z (1 | (1<<1)) #define FST_RCV_H (1 | (2<<1)) @@ -148,6 +159,7 @@ #define FST_RCV_W (1 | (4<<1)) #define FST_RCV_L (1 | (5<<1)) #define FST_RCV_D (1 | (6<<1)) +#define FST_RCV_Q (1 | (7<<1)) #define FST_RCV_STR "xzhuwl-?" /* 01234567 */ @@ -163,6 +175,82 @@ } +/* + * system-specific temp file handling + */ +#ifdef __MINGW32__ + +static FILE* tmpfile_open(char **nam) +{ +char *fname = NULL; +TCHAR szTempFileName[MAX_PATH]; +TCHAR lpTempPathBuffer[MAX_PATH]; +DWORD dwRetVal = 0; +UINT uRetVal = 0; +FILE *fh = NULL; + +dwRetVal = GetTempPath(MAX_PATH, lpTempPathBuffer); +if((dwRetVal > MAX_PATH) || (dwRetVal == 0)) + { + fprintf(stderr, "GetTempPath() failed in "__FILE__" line %d, exiting.\n", __LINE__); + exit(255); + } + else + { + uRetVal = GetTempFileName(lpTempPathBuffer, TEXT("FSTW"), 0, szTempFileName); + if (uRetVal == 0) + { + fprintf(stderr, "GetTempFileName() failed in "__FILE__" line %d, exiting.\n", __LINE__); + exit(255); + } + else + { + fname = strdup(szTempFileName); + } + } + +if(fname) + { + if(nam) { *nam = fname; } + fh = unlink_fopen("fname", "w+b"); + } + +return(fh); +} + +#else + +static FILE* tmpfile_open(char **nam) +{ +FILE *f = tmpfile(); /* replace with mkstemp() + fopen(), etc if this is not good enough */ +if(nam) { *nam = NULL; } +return(f); +} + +#endif + + +static void tmpfile_close(FILE **f, char **nam) +{ +if(f) + { + if(*f) { fclose(*f); *f = NULL; } + } + +if(nam) + { + if(*nam) + { + unlink(*nam); + free(*nam); + *nam = NULL; + } + } +} + +/*****************************************/ + + /* * to remove warn_unused_result compile time messages * (in the future there needs to be results checking) @@ -694,6 +782,11 @@ uint32_t path_array_count; unsigned fseek_failed : 1; + +char *geom_handle_nam; +char *valpos_handle_nam; +char *curval_handle_nam; +char *tchn_handle_nam; }; @@ -1010,7 +1103,8 @@ xc->compress_hier = use_compressed_hier; fstDetermineBreakSize(xc); -if((!nam)||(!(xc->handle=unlink_fopen(nam, "w+b")))) +if((!nam)|| + (!(xc->handle=unlink_fopen(nam, "w+b")))) { free(xc); xc=NULL; @@ -1024,14 +1118,13 @@ strcpy(hf + flen, ".hier"); xc->hier_handle = unlink_fopen(hf, "w+b"); - xc->geom_handle = tmpfile(); /* .geom */ - xc->valpos_handle = tmpfile(); /* .offs */ - xc->curval_handle = tmpfile(); /* .bits */ - xc->tchn_handle = tmpfile(); /* .tchn */ + xc->geom_handle = tmpfile_open(&xc->geom_handle_nam); /* .geom */ + xc->valpos_handle = tmpfile_open(&xc->valpos_handle_nam); /* .offs */ + xc->curval_handle = tmpfile_open(&xc->curval_handle_nam); /* .bits */ + xc->tchn_handle = tmpfile_open(&xc->tchn_handle_nam); /* .tchn */ xc->vchg_alloc_siz = xc->fst_break_size + xc->fst_break_add_size; xc->vchg_mem = malloc(xc->vchg_alloc_siz); - free(hf); if(xc->hier_handle && xc->geom_handle && xc->valpos_handle && xc->curval_handle && xc->vchg_mem && xc->tchn_handle) { xc->filename = strdup(nam); @@ -1047,15 +1140,18 @@ } else { - if(xc->hier_handle) fclose(xc->hier_handle); - if(xc->geom_handle) fclose(xc->geom_handle); - if(xc->valpos_handle) fclose(xc->valpos_handle); - if(xc->curval_handle) fclose(xc->curval_handle); - if(xc->tchn_handle) fclose(xc->tchn_handle); + fclose(xc->handle); + if(xc->hier_handle) { fclose(xc->hier_handle); unlink(hf); } + tmpfile_close(&xc->geom_handle, &xc->geom_handle_nam); + tmpfile_close(&xc->valpos_handle, &xc->valpos_handle_nam); + tmpfile_close(&xc->curval_handle, &xc->curval_handle_nam); + tmpfile_close(&xc->tchn_handle, &xc->tchn_handle_nam); free(xc->vchg_mem); free(xc); xc=NULL; } + + free(hf); } return(xc); @@ -1161,7 +1257,7 @@ #endif #endif -if((!xc)||(xc->vchg_siz <= 1)||(xc->already_in_flush)) return; +if((xc->vchg_siz <= 1)||(xc->already_in_flush)) return; xc->already_in_flush = 1; /* should really do this with a semaphore */ xc->section_header_only = 0; @@ -1291,6 +1387,8 @@ if(is_binary) { unsigned char acc = 0; +#ifdef FST_DISABLE_DUFFS_DEVICE + /* old algorithm */ int shift = 7 - ((vm4ip[1]-1) & 7); for(idx=vm4ip[1]-1;idx>=0;idx--) { @@ -1303,6 +1401,24 @@ acc = 0; } } +#else + /* new algorithm */ + idx = ((vm4ip[1]+7) & ~7); + switch(vm4ip[1] & 7) + { + case 0: do { acc = (pnt[idx+7-8] & 1) << 0; + case 7: acc |= (pnt[idx+6-8] & 1) << 1; + case 6: acc |= (pnt[idx+5-8] & 1) << 2; + case 5: acc |= (pnt[idx+4-8] & 1) << 3; + case 4: acc |= (pnt[idx+3-8] & 1) << 4; + case 3: acc |= (pnt[idx+2-8] & 1) << 5; + case 2: acc |= (pnt[idx+1-8] & 1) << 6; + case 1: acc |= (pnt[idx+0-8] & 1) << 7; + *(--scratchpnt) = acc; + idx -= 8; + } while(idx); + } +#endif scratchpnt = fstCopyVarint32ToLeft(scratchpnt, (time_delta << 1)); } @@ -1660,7 +1776,7 @@ #endif free(xc->valpos_mem); free(xc->vchg_mem); -fclose(xc->tchn_handle); +tmpfile_close(&xc->tchn_handle, &xc->tchn_handle_nam); free(xc); return(NULL); @@ -1703,7 +1819,7 @@ } xc->tchn_cnt = xc->tchn_idx = 0; - xc->tchn_handle = tmpfile(); + xc->tchn_handle = tmpfile_open(&xc->tchn_handle_nam); /* child thread will deallocate file/name */ fstWriterFseeko(xc, xc->tchn_handle, 0, SEEK_SET); fstFtruncate(fileno(xc->tchn_handle), 0); @@ -1975,11 +2091,11 @@ fstWriterUint64(xc->handle, xc->secnum); fflush(xc->handle); - if(xc->tchn_handle) { fclose(xc->tchn_handle); xc->tchn_handle = NULL; } + tmpfile_close(&xc->tchn_handle, &xc->tchn_handle_nam); free(xc->vchg_mem); xc->vchg_mem = NULL; - if(xc->curval_handle) { fclose(xc->curval_handle); xc->curval_handle = NULL; } - if(xc->valpos_handle) { fclose(xc->valpos_handle); xc->valpos_handle = NULL; } - if(xc->geom_handle) { fclose(xc->geom_handle); xc->geom_handle = NULL; } + tmpfile_close(&xc->curval_handle, &xc->curval_handle_nam); + tmpfile_close(&xc->valpos_handle, &xc->valpos_handle_nam); + tmpfile_close(&xc->geom_handle, &xc->geom_handle_nam); if(xc->hier_handle) { fclose(xc->hier_handle); xc->hier_handle = NULL; } if(xc->handle) { @@ -2988,6 +3104,9 @@ int writex_fd; unsigned char writex_buf[FST_WRITEX_MAX]; #endif + +char *f_nam; +char *fh_nam; }; @@ -3465,7 +3584,6 @@ static int fstVcdIDForFwrite(char *buf, unsigned int value) { char *pnt = buf; -unsigned int vmod; /* zero is illegal for a value...it is assumed they start at one */ while (value) @@ -3508,14 +3626,16 @@ sprintf(fnam, "%s.hier_%d_%p", xc->filename, getpid(), (void *)xc); fstReaderFseeko(xc, xc->f, xc->hier_pos, SEEK_SET); uclen = fstReaderUint64(xc->f); +#ifndef __MINGW32__ fflush(xc->f); - +#endif if(htyp == FST_BL_HIER) { fstReaderFseeko(xc, xc->f, xc->hier_pos, SEEK_SET); uclen = fstReaderUint64(xc->f); +#ifndef __MINGW32__ fflush(xc->f); - +#endif zfd = dup(fileno(xc->f)); zhandle = gzdopen(zfd, "rb"); if(!zhandle) @@ -3532,7 +3652,9 @@ fstReaderFseeko(xc, xc->f, xc->hier_pos - 8, SEEK_SET); /* get section len */ clen = fstReaderUint64(xc->f) - 16; uclen = fstReaderUint64(xc->f); +#ifndef __MINGW32__ fflush(xc->f); +#endif } #ifndef __MINGW32__ @@ -3540,10 +3662,11 @@ if(!xc->fh) #endif { - xc->fh = tmpfile(); + xc->fh = tmpfile_open(&xc->fh_nam); free(fnam); fnam = NULL; if(!xc->fh) { + tmpfile_close(&xc->fh, &xc->fh_nam); free(mem); return(0); } @@ -4131,9 +4254,9 @@ fcomp = fopen(hf, "w+b"); if(!fcomp) { - fcomp = tmpfile(); + fcomp = tmpfile_open(&xc->f_nam); free(hf); hf = NULL; - if(!fcomp) return(0); + if(!fcomp) { tmpfile_close(&fcomp, &xc->f_nam); return(0); } } #if defined(FST_MACOSX) @@ -4152,7 +4275,9 @@ #endif fstReaderFseeko(xc, xc->f, 1+8+8, SEEK_SET); +#ifndef __MINGW32__ fflush(xc->f); +#endif zfd = dup(fileno(xc->f)); zhandle = gzdopen(zfd, "rb"); @@ -4501,12 +4626,12 @@ if(xc->fh) { - fclose(xc->fh); xc->fh = NULL; + tmpfile_close(&xc->fh, &xc->fh_nam); } if(xc->f) { - fclose(xc->f); xc->f = NULL; + tmpfile_close(&xc->f, &xc->f_nam); if(xc->filename_unpacked) { unlink(xc->filename_unpacked); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gtkwave-3.3.58/src/helpers/vcd2fst.c new/gtkwave-3.3.59/src/helpers/vcd2fst.c --- old/gtkwave-3.3.58/src/helpers/vcd2fst.c 2014-02-18 00:46:26.000000000 +0100 +++ new/gtkwave-3.3.59/src/helpers/vcd2fst.c 2014-04-21 08:21:59.000000000 +0200 @@ -55,6 +55,20 @@ static uint32_t var_direction_idx = 0; static unsigned char *var_direction = NULL; + +static void *realloc_2(void *ptr, size_t siz) /* cppcheck */ +{ +void *pnt = realloc(ptr, siz); +if(!pnt) + { + fprintf(stderr, "ERROR: Out of memory in realloc(), exiting!\n"); /* normally free(ptr) here */ + exit(255); + } + +return(pnt); +} + + /*********************************************************/ /*** vvv extload component type name determination vvv ***/ /*********************************************************/ @@ -380,7 +394,7 @@ while(((*wbuf)[*len] != 1) && !feof(f)) { /* fprintf(stderr, "overflow %d\n", (int)(*len)); */ - *wbuf = realloc(*wbuf, (*len) * 2 + 1); + *wbuf = realloc_2(*wbuf, (*len) * 2 + 1); (*wbuf)[(*len) * 2] = 1; fgets_rc = fgets(*wbuf + (*len), (*len) + 1, f); @@ -507,6 +521,7 @@ { printf("Could not open '%s', exiting.\n", vname); free(bin_fixbuff); bin_fixbuff = NULL; + free(vname); free(fstname); exit(255); } @@ -516,6 +531,8 @@ { printf("Could not open '%s', exiting.\n", fstname); free(bin_fixbuff); bin_fixbuff = NULL; + free(vname); free(fstname); + fclose(f); exit(255); } @@ -1350,7 +1367,7 @@ if(node_len >= bin_fixbuff_len) { bin_fixbuff_len = node_len + 1; - bin_fixbuff = realloc(bin_fixbuff, bin_fixbuff_len); + bin_fixbuff = realloc_2(bin_fixbuff, bin_fixbuff_len); } memset(bin_fixbuff, buf[1] != '1' ? buf[1] : '0', delta); @@ -1376,7 +1393,7 @@ if(node_len >= bin_fixbuff_len) { bin_fixbuff_len = node_len + 1; - bin_fixbuff = realloc(bin_fixbuff, bin_fixbuff_len); + bin_fixbuff = realloc_2(bin_fixbuff, bin_fixbuff_len); } memset(bin_fixbuff, buf[1] != '1' ? buf[1] : '0', delta); @@ -1428,7 +1445,7 @@ if(p_len >= bin_fixbuff_len) { bin_fixbuff_len = p_len + 1; - bin_fixbuff = realloc(bin_fixbuff, bin_fixbuff_len); + bin_fixbuff = realloc_2(bin_fixbuff, bin_fixbuff_len); } pnt = bin_fixbuff; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gtkwave-3.3.58/src/helpers/vzt_read.c new/gtkwave-3.3.59/src/helpers/vzt_read.c --- old/gtkwave-3.3.58/src/helpers/vzt_read.c 2014-03-01 23:50:23.000000000 +0100 +++ new/gtkwave-3.3.59/src/helpers/vzt_read.c 2014-04-11 01:23:04.000000000 +0200 @@ -1436,7 +1436,7 @@ vpa->lt = lt; vpa->b = b; -vzt_rd_pthread_create(lt, &b->pth, &b->pth_attr, vzt_rd_decompress_blk_pth_actual, vpa); +vzt_rd_pthread_create(lt, &b->pth, &b->pth_attr, vzt_rd_decompress_blk_pth_actual, vpa); /* cppcheck misfires thinking vpa is not freed even though vzt_rd_decompress_blk_pth_actual() does it */ } /* diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gtkwave-3.3.58/src/ptranslate.c new/gtkwave-3.3.59/src/ptranslate.c --- old/gtkwave-3.3.58/src/ptranslate.c 2012-01-05 21:52:20.000000000 +0100 +++ new/gtkwave-3.3.59/src/ptranslate.c 2014-04-11 01:23:04.000000000 +0200 @@ -140,8 +140,8 @@ if((strlen(abs_path) == 0)||(!result)) { status_text("Could not find filter process!\n"); + pclose(stream); /* cppcheck */ return; - } pclose(stream); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gtkwave-3.3.58/src/ttranslate.c new/gtkwave-3.3.59/src/ttranslate.c --- old/gtkwave-3.3.58/src/ttranslate.c 2014-03-04 00:59:31.000000000 +0100 +++ new/gtkwave-3.3.59/src/ttranslate.c 2014-04-11 01:23:04.000000000 +0200 @@ -159,6 +159,7 @@ if((strlen(abs_path) == 0)||(!result)) { status_text("Could not find transaction filter process!\n"); + pclose(stream); /* cppcheck */ return; } -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@hilbert.suse.de