Changeset 362


Ignore:
Timestamp:
Oct 19, 2011, 12:16:31 AM (13 years ago)
Author:
katerina
Message:

Fix for ticket #267 (Multiple compiler warnings with gcc 4.6.1).

Location:
trunk/src
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/dnmalloc.c

    r279 r362  
    66      Email: dnmalloc@fort-knox.org
    77      Address:
     8#if defined(WITH_TPT)
    89             Yves Younan
    910             Celestijnenlaan 200A
     
    45084509
    45094510    else {
     4511#if  PARANOIA > 0
    45104512      int ret;
     4513#endif
    45114514      INTERNAL_SIZE_T offset = (INTERNAL_SIZE_T) p->hash_next;
    45124515      av->n_mmaps--;
    45134516      av->mmapped_mem -= (size + offset);
     4517#if  PARANOIA > 0
    45144518      ret = munmap((char*) chunk(p) - offset, size + offset);
     4519#else
     4520      munmap((char*) chunk(p) - offset, size + offset);
     4521#endif
    45154522      hashtable_remove_mmapped(chunk(p));
    45164523      freecilst_add(p);
     
    50075014  CHUNK_SIZE_T    remainder_size; /* its size */
    50085015  INTERNAL_SIZE_T size;
     5016#if PARANOIA > 2
    50095017  mstate          av;
     5018#endif
    50105019
    50115020  /* If need less alignment than we give anyway, just relay to malloc */
     
    50385047  if (m == 0) return 0; /* propagate failure */
    50395048
     5049#if PARANOIA > 2
    50405050  av = get_malloc_state();
     5051#endif
    50415052
    50425053  p = hashtable_lookup((mchunkptr) m);
  • trunk/src/sh_database.c

    r296 r362  
    12441244  char * values;
    12451245
    1246   int    status;
    12471246  long   the_id;
    12481247  int    size;
     
    14451444                      db_table, columns, values);
    14461445
    1447   status = sh_database_query (query, &the_id);
     1446  sh_database_query (query, &the_id);
    14481447
    14491448  /*@-usedef@*//* no, 'values' is allocated here */
  • trunk/src/sh_err_console.c

    r252 r362  
    6969{
    7070  key_t            key;
    71   int              error;
    72 #if defined(WITH_TPT)
     71#if defined(WITH_TPT)
     72  int              error = 0;
    7373  char errbuf[SH_ERRBUF_SIZE];
    7474#endif
     
    8181  if (key == (key_t) -1)
    8282    {
     83#if defined(WITH_TPT)
    8384      error = errno;
     85#endif
    8486      TPT(( 0, FIL__, __LINE__, _("msg=<ftok: %s> errno=<%d>\n"),
    8587            sh_error_message(error, errbuf, sizeof(errbuf)), error));
     
    9395  if (msgid < 0)
    9496    {
     97#if defined(WITH_TPT)
    9598      error = errno;
     99#endif
    96100      TPT(( 0, FIL__, __LINE__, _("msg=<msgget: %s> errno=<%d>\n"),
    97101            sh_error_message(error, errbuf, sizeof(errbuf)), error));
     
    132136  int              rc       = -1;
    133137  static int       status   = -1;
    134   int              error;
    135138  int              count    = 0;
    136139#if defined(WITH_TPT)
     140  int              error = 0;
    137141  char errbuf[SH_ERRBUF_SIZE];
    138142#endif
     
    205209      else
    206210        {
     211#if defined(WITH_TPT)
    207212          error = errno;
     213#endif
    208214          TPT(( 0, FIL__, __LINE__, _("msg=<msgsnd: %s> errno=<%d>\n"),
    209215                sh_error_message(error, errbuf, sizeof(errbuf)), error));
  • trunk/src/sh_files.c

    r356 r362  
    7676static char * sh_files_C_dequote (char * s, size_t * length)
    7777{
    78   size_t i, j, len = *length;
     78  size_t i, len = *length;
    7979  int    flag = 0;
    8080  char  *p, *q, *po, *pend;
     
    9696  po = SH_ALLOC(len+1); *po = '\0'; p = po; pend = &po[len];
    9797
    98   i = 0; j = 0; q = s;
     98  i = 0; q = s;
    9999
    100100  do
  • trunk/src/sh_hash.c

    r356 r362  
    435435  char hashbuf[KEYBUF_SIZE];
    436436  int  retval;
    437   volatile int flag = 0;
    438437
    439438  /* --------  find the entry for the file ----------------       */
     
    462461  sh_error_handle (level, FIL__, __LINE__, 0,
    463462                   MSG_FI_MISS2, tmp, str);
    464   flag = 1;
     463
    465464  SH_FREE(tmp);
    466465  SH_FREE(str);
     
    13021301  extern int get_the_fd (SL_TICKET ticket);
    13031302
    1304   int    flag_pgp;
    1305   int    flag_nohead;
    13061303  SL_TICKET fdTmp = (-1);
    13071304#endif
     
    13141311
    13151312  SH_MUTEX_LOCK(mutex_hash);
    1316 
    1317 #if defined(WITH_GPG) || defined(WITH_PGP)
    1318   flag_pgp = S_FALSE;
    1319   flag_nohead = S_FALSE;
    1320 #endif
    13211313
    13221314  if (IsInit == 1)
     
    38853877  size_t size       = 0;
    38863878  size_t flag_quote = 0;
    3887   int    flag_comma = 0;
     3879
    38883880  char * new;
    38893881  char * pnew;
     
    38943886      while (*p)
    38953887        {
    3896           if (*p == ',')
    3897             flag_comma = 1;
    3898           else if (*p == '"')
     3888          if (*p == '"')
    38993889            ++flag_quote;
    39003890         
  • trunk/src/sh_kern.c

    r348 r362  
    848848
    849849  unsigned short idt_offset_lo, idt_offset_hi, idt_selector;
    850   unsigned char  idt_reserved, idt_flag;
     850  unsigned char  /* idt_reserved, */ idt_flag;
    851851  unsigned short sh_idt_offset_lo, sh_idt_offset_hi, sh_idt_selector;
    852   unsigned char  sh_idt_reserved, sh_idt_flag;
     852  unsigned char  /* sh_idt_reserved, */ sh_idt_flag;
    853853  int            dpl;
    854854  unsigned long  idt_iaddr;
     
    889889              sh_idt_offset_lo = *((unsigned short *) &sh_idt_table[i]);
    890890              sh_idt_selector  = *((unsigned short *) &sh_idt_table[i+2]);
    891               sh_idt_reserved  = (unsigned char) sh_idt_table[i+4];
     891              /* sh_idt_reserved  = (unsigned char) sh_idt_table[i+4]; */
    892892              sh_idt_flag      = (unsigned char) sh_idt_table[i+5];
    893893              sh_idt_offset_hi = *((unsigned short *) &sh_idt_table[i+6]);
     
    919919                  idt_offset_lo = *((unsigned short *) &idt_table[i]);
    920920                  idt_selector  = *((unsigned short *) &idt_table[i+2]);
    921                   idt_reserved  = (unsigned char) idt_table[i+4];
     921                  /* idt_reserved  = (unsigned char) idt_table[i+4]; */
    922922                  idt_flag      = (unsigned char) idt_table[i+5];
    923923                  idt_offset_hi = *((unsigned short *) &idt_table[i+6]);
  • trunk/src/sh_log_check.c

    r358 r362  
    10271027 *  Reader for binary files
    10281028 */
    1029 sh_string * sh_binary_reader (void * s, size_t size, struct sh_logfile * logfile)
     1029sh_string * sh_binary_reader (void * s, size_t size,
     1030                              struct sh_logfile * logfile)
    10301031{
    10311032  size_t         status;
     
    10401041      if (status != 1)
    10411042        {
     1043          memset(s, '\0', size);
    10421044          if (ferror(logfile->fp) && (logfile->flags & SH_LOGFILE_PIPE) == 0)
    10431045            {
     
    10531055          sl_fclose(FIL__, __LINE__, logfile->fp);
    10541056          logfile->fp = NULL;
    1055           memset(s, '\0', size);
    10561057          return NULL;
    10571058        }
     
    13871388      retval = -1;
    13881389    }
    1389 
    1390   sh_logmon_interval = (time_t) val;
    1391   SL_RETURN(0, _("sh_logmon_set_interval"));
     1390  else
     1391    {
     1392      sh_logmon_interval = (time_t) val;
     1393    }
     1394  SL_RETURN(retval, _("sh_logmon_set_interval"));
    13921395}
    13931396
  • trunk/src/sh_log_parse_apache.c

    r357 r362  
    6565static void * sh_dummy_new = NULL;
    6666static void * sh_dummy_fti = NULL;
     67static void * sh_dummy_ftr = NULL;
    6768
    6869void * sh_eval_fileinfo_apache(char * str)
     
    8990  sh_dummy_new = (void*) &new;
    9091  sh_dummy_fti = (void*) &f_time;
     92  sh_dummy_ftr = (void*) &result;
    9193
    9294  if (0 == strncmp("common", str, 6))
  • trunk/src/sh_log_parse_generic.c

    r301 r362  
    4747{
    4848  struct tm ts;
    49   struct tm * ts_p;
    5049  char   tmp[80];
    5150  size_t len;
     
    5453 
    5554#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_LOCALTIME_R)
    56   ts_p = localtime_r (&(record->timestamp), &ts);
     55  localtime_r (&(record->timestamp), &ts);
    5756#else
    58   ts_p = localtime (&(record->timestamp));
    59   memcpy(&ts, ts_p, sizeof(struct tm));
     57  memcpy(&ts, localtime(&(record->timestamp)), sizeof(struct tm));
    6058#endif
    6159  len = strftime(tmp, sizeof(tmp), _("%Y-%m-%dT%H:%M:%S"), &ts);
  • trunk/src/sh_mail.c

    r295 r362  
    18631863static dnsrep * return_mx (char *domain)
    18641864{
    1865   struct hostent *host;
    18661865  dnsrep * answers = NULL;
    18671866  mx     * result;
     
    19081907
    19091908      retval = NULL;
    1910       host   = NULL;
    19111909
    19121910      if (domain != NULL)
  • trunk/src/sh_portcheck.c

    r335 r362  
    193193      retval = -1;
    194194    }
    195 
    196   sh_portchk_interval = (time_t) val;
    197   SL_RETURN(0, _("sh_portchk_set_interval"));
     195  else
     196    {
     197      sh_portchk_interval = (time_t) val;
     198    }
     199  SL_RETURN(retval, _("sh_portchk_set_interval"));
    198200}
    199201
     
    213215      retval = -1;
    214216    }
    215 
    216   *setthis = (int) val;
    217   SL_RETURN(0, _("sh_portchk_set_port_minmax"));
     217  else
     218    {
     219      *setthis = (int) val;
     220    }
     221  SL_RETURN(retval, _("sh_portchk_set_port_minmax"));
    218222}
    219223
  • trunk/src/sh_processcheck.c

    r338 r362  
    632632      retval = -1;
    633633    }
    634 
    635   sh_prochk_interval = (time_t) val;
    636   SL_RETURN(0, _("sh_prochk_set_interval"));
     634  else
     635    {
     636      sh_prochk_interval = (time_t) val;
     637    }
     638  SL_RETURN(retval, _("sh_prochk_set_interval"));
    637639}
    638640
  • trunk/src/sh_socket.c

    r315 r362  
    11261126char * sh_socket_check(const char * client_name)
    11271127{
    1128   struct socket_cmd * old = cmdlist;
    11291128  struct socket_cmd * new = cmdlist;
    11301129  static char         out[SH_MAXMSGLEN];
     
    11391138          return out;
    11401139        }
    1141       old = new;
    11421140      new = new->next;
    11431141    }
  • trunk/src/sh_unix.c

    r343 r362  
    21692169  struct tm   aa;
    21702170  struct tm   bb;
    2171   struct tm * cc;
     2171
    21722172  int  sign =  0;
    21732173  int  diff =  0;
     
    21782178
    21792179#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GMTIME_R)
    2180   cc = gmtime_r (xx, &aa);
    2181 #else
    2182   cc = gmtime (xx);
    2183   memcpy (&aa, cc, sizeof(struct tm));
     2180  gmtime_r (xx, &aa);
     2181#else
     2182  memcpy (&aa, gmtime(xx), sizeof(struct tm));
    21842183#endif
    21852184
    21862185#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_LOCALTIME_R)
    2187   cc = localtime_r (xx, &bb);
    2188 #else
    2189   cc = localtime (xx);
    2190   memcpy (&bb, cc, sizeof(struct tm));
     2186  localtime_r (xx, &bb);
     2187#else
     2188  memcpy (&bb, localtime(xx), sizeof(struct tm));
    21912189#endif
    21922190
Note: See TracChangeset for help on using the changeset viewer.