Changeset 2135 for libswish3

Show
Ignore:
Timestamp:
04/19/08 22:05:33 (9 months ago)
Author:
karpet
Message:

make warnings optional

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • libswish3/trunk/src/libswish3/error.c

    r2103 r2135  
    3131 
    3232extern int SWISH_DEBUG; 
     33extern int SWISH_WARNINGS; 
    3334 
    3435static FILE *error_handle = NULL; 
     
    8182    if (!error_handle) 
    8283        error_handle = stderr; 
     84         
     85    if (!SWISH_WARNINGS) 
     86        return; 
    8387 
    8488    va_start(args, msgfmt); 
  • libswish3/trunk/src/libswish3/hash.c

    r2133 r2135  
    126126    if (h == NULL) { 
    127127        SWISH_CROAK("error creating hash of size %d", size); 
    128         return NULL; 
     128        return NULL; // never get here 
    129129    } 
    130130 
  • libswish3/trunk/src/libswish3/swish.c

    r2129 r2135  
    2222 
    2323int SWISH_DEBUG = 0;            /* global var */ 
     24int SWISH_WARNINGS = 1;         /* global var */ 
    2425 
    2526swish_3 * 
     
    9495    setenv("SWISH_DEBUG_PARSER", "0", 0); 
    9596    setenv("SWISH_DEBUG_NAMEDBUFFER", "0", 0); 
     97    setenv("SWISH_WARNINGS", "1", 0); 
    9698    if (!SWISH_DEBUG) { 
    9799 
     
    119121        } 
    120122    } 
     123     
     124    SWISH_WARNINGS = swish_string_to_int(getenv("SWISH_WARNINGS")); 
    121125 
    122126/*