Changeset ec0f79b5ee03bd254353c5cb634373649f79ebc2

Show
Ignore:
Timestamp:
02/21/11 17:06:05 (4 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1298307965 +0000
git-parent:

[1a778bd1b1b6f321eff6ff69403dd1cd55d8ef1a]

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

several warning (now error) fixes on Linux

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/eventer/eventer_jobq.c

    r09ecd28 rec0f79b  
    4444#endif 
    4545 
     46#define pthread_self_ptr() ((void *)pthread_self()) 
     47 
    4648static noit_atomic32_t threads_jobq_inited = 0; 
    4749static pthread_key_t threads_jobq; 
     
    235237  job->timeout_triggered = 1; 
    236238  job->timeout_event = NULL; 
    237   noitL(eventer_deb, "%p jobq -> timeout job [%p]\n", pthread_self(), job); 
     239  noitL(eventer_deb, "%p jobq -> timeout job [%p]\n", pthread_self_ptr(), job); 
    238240  if(job->inflight) { 
    239241    eventer_job_t *jobcopy; 
     
    249251        /* We need to cleanup... we haven't done it yet. */ 
    250252        noitL(eventer_deb, "[inline] %p jobq[%s] -> cleanup [%p]\n", 
    251               pthread_self(), job->jobq->queue_name, job); 
     253              pthread_self_ptr(), job->jobq->queue_name, job); 
    252254        /* This is the real question... asynch cleanup is supposed to 
    253255         * be called asynch -- we're going to call it synchronously 
     
    334336    } 
    335337    pthread_setspecific(jobq->activejob, job); 
    336     noitL(eventer_deb, "%p jobq[%s] -> running job [%p]\n", pthread_self(), jobq->queue_name, job); 
     338    noitL(eventer_deb, "%p jobq[%s] -> running job [%p]\n", pthread_self_ptr(), 
     339          jobq->queue_name, job); 
    337340 
    338341    /* Mark our commencement */ 
     
    346349       * to pull the job off the queue.  We must be in bad shape here. 
    347350       */ 
    348       noitL(eventer_deb, "%p jobq[%s] -> timeout before start [%p]\n", pthread_self(), jobq->queue_name, job); 
     351      noitL(eventer_deb, "%p jobq[%s] -> timeout before start [%p]\n", 
     352            pthread_self_ptr(), jobq->queue_name, job); 
    349353      gettimeofday(&job->finish_time, NULL); /* We're done */ 
    350354      sub_timeval(job->finish_time, job->fd_event->whence, &diff); 
    351355      sub_timeval(job->finish_time, job->create_time, &diff2); 
    352356      noitL(eventer_deb, "%p jobq[%s] -> timeout before start [%p] -%0.6f (%0.6f)\n", 
    353             pthread_self(), jobq->queue_name, job, 
     357            pthread_self_ptr(), jobq->queue_name, job, 
    354358            (float)diff.tv_sec + (float)diff.tv_usec/1000000.0, 
    355359            (float)diff2.tv_sec + (float)diff2.tv_usec/1000000.0); 
     
    375379      if(noit_atomic_cas32(&job->inflight, 1, 0) == 0) { 
    376380        if(!job->timeout_triggered) { 
    377           noitL(eventer_deb, "%p jobq[%s] -> executing [%p]\n", pthread_self(), jobq->queue_name, job); 
     381          noitL(eventer_deb, "%p jobq[%s] -> executing [%p]\n", 
     382                pthread_self_ptr(), jobq->queue_name, job); 
    378383          /* Choose the right cancellation policy (or none) */ 
    379384          if(job->fd_event->mask & EVENTER_CANCEL_ASYNCH) { 
     
    406411 
    407412    job->inflight = 0; 
    408     noitL(eventer_deb, "%p jobq[%s] -> finished [%p]\n", pthread_self(), jobq->queue_name, job); 
     413    noitL(eventer_deb, "%p jobq[%s] -> finished [%p]\n", pthread_self_ptr(), 
     414          jobq->queue_name, job); 
    409415    /* No we know we won't have siglongjmp called on us */ 
    410416 
     
    418424    if(noit_atomic_cas32(&job->has_cleanedup, 1, 0) == 0) { 
    419425      /* We need to cleanup... we haven't done it yet. */ 
    420       noitL(eventer_deb, "%p jobq[%s] -> cleanup [%p]\n", pthread_self(), jobq->queue_name, job); 
     426      noitL(eventer_deb, "%p jobq[%s] -> cleanup [%p]\n", pthread_self_ptr(), 
     427            jobq->queue_name, job); 
    421428      if(job->fd_event) 
    422429        job->fd_event->callback(job->fd_event, EVENTER_ASYNCH_CLEANUP, 
  • src/modules/external_proc.c

    r61205cb rec0f79b  
    118118  ps = noit_skiplist_find_compare(&active_procs, &pid, &iter, __proc_state_pid); 
    119119  noitL(nldeb, "reaped pid %d (check: %lld) -> %x\n", 
    120         pid, ps?ps->check_no:-1, status); 
     120        pid, (long long int)(ps?ps->check_no:-1), status); 
    121121  if(ps) { 
    122122    ps->status = status; 
     
    186186  noitL(noit_error, "%d done procs to cleanup\n", done_procs.size); 
    187187  while((ps = noit_skiplist_pop(&done_procs, NULL)) != NULL) { 
    188     noitL(noit_error, "finished %lld/%d\n", ps->check_no, ps->pid); 
     188    noitL(noit_error, "finished %lld/%d\n", (long long int)ps->check_no, ps->pid); 
    189189    if(ps->cancelled == 0) { 
    190190      assert_write(out_fd, &ps->check_no, 
  • src/noit_capabilities_listener.c

    r629726b rec0f79b  
    9090    gettimeofday(&now, NULL); 
    9191    snprintf(vbuff, sizeof(vbuff), "%llu.%03d", (unsigned long long)now.tv_sec, 
    92              now.tv_usec / 1000); 
     92             (int)(now.tv_usec / 1000)); 
    9393    xmlNewTextChild(root, NULL, (xmlChar *)"current_time", (xmlChar *)vbuff); 
    9494 
  • src/noit_check_log.c

    r8c720f9 rec0f79b  
    195195                         "M\t%lu.%03lu\t%s\t%s\t%c\t%lld\n", 
    196196                         SECPART(&c->whence), MSECPART(&c->whence), uuid_str, 
    197                          m->metric_name, m->metric_type, *(m->metric_value.l)); 
     197                         m->metric_name, m->metric_type, 
     198                         (long long int)*(m->metric_value.l)); 
    198199          break; 
    199200        case METRIC_UINT64: 
     
    201202                         "M\t%lu.%03lu\t%s\t%s\t%c\t%llu\n", 
    202203                         SECPART(&c->whence), MSECPART(&c->whence), uuid_str, 
    203                          m->metric_name, m->metric_type, *(m->metric_value.L)); 
     204                         m->metric_name, m->metric_type, 
     205                         (long long unsigned int)*(m->metric_value.L)); 
    204206          break; 
    205207        case METRIC_DOUBLE: 
     
    246248        rv = snprintf(b, l, "%u", *(m->metric_value.I)); break; 
    247249      case METRIC_INT64: 
    248         rv = snprintf(b, l, "%lld", *(m->metric_value.l)); break; 
     250        rv = snprintf(b, l, "%lld", (long long int)*(m->metric_value.l)); break; 
    249251      case METRIC_UINT64: 
    250         rv = snprintf(b, l, "%llu", *(m->metric_value.L)); break; 
     252        rv = snprintf(b, l, "%llu", 
     253                      (long long unsigned int)*(m->metric_value.L)); break; 
    251254      case METRIC_DOUBLE: 
    252255        rv = snprintf(b, l, "%.12e", *(m->metric_value.n)); break; 
  • src/noit_conf.c

    r8c720f9 rec0f79b  
    381381                             const char *path, 
    382382                             noit_hash_table *table) { 
    383   int cnt; 
     383  unsigned int cnt; 
    384384  xmlXPathObjectPtr pobj = NULL; 
    385385  xmlXPathContextPtr current_ctxt; 
  • src/noit_http.c

    r4a4fa32 rec0f79b  
    610610void 
    611611noit_http_process_querystring(noit_http_request *req) { 
    612   char *cp, *interest, *brk
     612  char *cp, *interest, *brk = NULL
    613613  cp = strchr(req->uri_str, '?'); 
    614614  if(!cp) return; 
  • src/stratcon_jlog_streamer.c

    rbf14ffc rec0f79b  
    117117                            &((struct sockaddr_in *)&addr6)->sin_addr, 
    118118                            buff, sizeof(buff)); 
    119         port = ntohs(((struct sockaddr_in *)&addr6)->sin_port); 
     119        memcpy(&port, &((struct sockaddr_in *)&addr6)->sin_port, sizeof(port)); 
     120        port = ntohs(port); 
    120121      } 
    121122      else if(addr6.sin6_family == AF_INET6) { 
     
    980981} while(0) 
    981982#define push_noit_m_u64(name, value) do { \ 
    982   snprintf(wr, len, "%s\tL\t%llu\n", name, value); \ 
     983  snprintf(wr, len, "%s\tL\t%llu\n", name, (long long unsigned int)value); \ 
    983984  stratcon_datastore_push(DS_OP_INSERT, \ 
    984985                          (struct sockaddr *)&self_stratcon_ip, \ 
     
    11411142                              &((struct sockaddr_in *)&addr6)->sin_addr, 
    11421143                              buff, sizeof(buff)); 
    1143           port = ntohs(((struct sockaddr_in *)&addr6)->sin_port); 
     1144          memcpy(&port, &((struct sockaddr_in *)&addr6)->sin_port, sizeof(port)); 
     1145          port = ntohs(port); 
    11441146        } 
    11451147        else if(addr6.sin6_family == AF_INET6) {