Changeset f99cf462c3bf905a727087a97e5c305a52256d5e

Show
Ignore:
Timestamp:
03/17/09 18:23:09 (6 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1237314189 +0000
git-parent:

[1712d2083a4d20733321e30c097dbcd337332eee]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1237314189 +0000
Message:

add a string specific retrieve to make common const char * str fetches easiser. Fix some warnings in utils. refs #34

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/utils/noit_hash.c

    rb7ec807 rf99cf46  
    220220  return 0; 
    221221} 
     222int noit_hash_retr_str(noit_hash_table *h, const char *k, int klen, const char **dstr) { 
     223  int rv; 
     224  void *vptr = NULL; 
     225  rv = noit_hash_retrieve(h,k,klen,&vptr); 
     226  *dstr = vptr; 
     227  return rv; 
     228} 
    222229int noit_hash_delete(noit_hash_table *h, const char *k, int klen, 
    223230                  NoitHashFreeFunc keyfree, NoitHashFreeFunc datafree) { 
  • src/utils/noit_hash.h

    rb7ec807 rf99cf46  
    7676                      NoitHashFreeFunc keyfree, NoitHashFreeFunc datafree); 
    7777int noit_hash_retrieve(noit_hash_table *h, const char *k, int klen, void **data); 
     78int noit_hash_retr_str(noit_hash_table *h, const char *k, int klen, const char **data); 
    7879int noit_hash_delete(noit_hash_table *h, const char *k, int klen, 
    7980                     NoitHashFreeFunc keyfree, NoitHashFreeFunc datafree); 
  • src/utils/noit_log.c

    r84d6f13 rf99cf46  
    254254noit_log_stream_t 
    255255noit_log_stream_find(const char *name) { 
    256   noit_log_stream_t ls; 
    257   if(noit_hash_retrieve(&noit_loggers, name, strlen(name), (void **)&ls)) { 
    258     return ls; 
     256  void *vls; 
     257  if(noit_hash_retrieve(&noit_loggers, name, strlen(name), &vls)) { 
     258    return (noit_log_stream_t)vls; 
    259259  } 
    260260  return NULL; 
     
    374374      strftime(tbuf, sizeof(tbuf), "%Y-%m-%d %H:%M:%S", tm); 
    375375      snprintf(fbuf, sizeof(fbuf), "[%s.%06d %s:%d] %s", 
    376                tbuf, now->tv_usec, file, line, format); 
     376               tbuf, (int)now->tv_usec, file, line, format); 
    377377      format = fbuf; 
    378378    }