Ticket #19: jabberd2_fix_many_compile_warnings.diff
| File jabberd2_fix_many_compile_warnings.diff, 13.6 KB (added by smoku, 21 months ago) |
|---|
-
sm/mm.c
44 44 45 45 mm_t mm_new(sm_t sm) { 46 46 mm_t mm; 47 int celem, melem, attr, i,*nlist = NULL;47 int celem, melem, attr, *nlist = NULL; 48 48 char id[13], name[32], mod_fullpath[512], arg[1024], *modules_path; 49 49 mod_chain_t chain = (mod_chain_t) NULL; 50 50 mod_instance_t **list = NULL, mi; -
sm/mod_amp.c
104 104 105 105 static mod_ret_t _amp_in_sess(mod_instance_t mi, sess_t sess, pkt_t pkt) { 106 106 mod_amp_config_t config = (mod_amp_config_t) mi->mod->private; 107 int ns, elem, attr;108 107 109 108 /* only handle messages */ 110 109 if (pkt->type != pkt_MESSAGE) -
sm/sm.h
324 324 sess_t sess_start(sm_t sm, jid_t jid); 325 325 void sess_end(sess_t sess); 326 326 sess_t sess_match(user_t user, char *resource); 327 sess_t sess_match_exact(user_t user, char *resource); 327 328 328 329 user_t user_load(sm_t sm, jid_t jid); 329 330 void user_free(user_t user); -
sm/mod_roster.c
149 149 for(scan = user->sessions; scan != NULL; scan = scan->next) 150 150 { 151 151 /* don't push to us or to anyone who hasn't loaded the roster */ 152 if( (int) scan->module_data[mod_index] == 0)152 if(scan->module_data[mod_index] == NULL) 153 153 continue; 154 154 155 155 push = pkt_dup(pkt, jid_full(scan->jid), NULL); -
c2s/c2s.c
23 23 static int _c2s_client_sx_callback(sx_t s, sx_event_t e, void *data, void *arg) { 24 24 sess_t sess = (sess_t) arg; 25 25 sx_buf_t buf = (sx_buf_t) data; 26 int rlen, len, ns, elem, attr , i, r;26 int rlen, len, ns, elem, attr; 27 27 sx_error_t *sxe; 28 28 nad_t nad; 29 29 char root[9]; -
sx/ssl.c
154 154 if( ((_sx_ssl_conn_t)s->plugin_data[p->index])->pemfile != NULL ) 155 155 free(((_sx_ssl_conn_t)s->plugin_data[p->index])->pemfile); 156 156 free(s->plugin_data[p->index]); 157 s->plugin_data[p->index] = =NULL;157 s->plugin_data[p->index] = NULL; 158 158 } 159 159 160 160 _sx_debug(ZONE, "server can't handle ssl, business as usual"); … … 621 621 622 622 free(sc); 623 623 624 s->plugin_data[p->index] = =NULL;624 s->plugin_data[p->index] = NULL; 625 625 } 626 626 627 627 static void _sx_ssl_unload(sx_plugin_t p) { … … 716 716 } 717 717 718 718 int sx_ssl_client_starttls(sx_plugin_t p, sx_t s, char *pemfile) { 719 assert((int) p);720 assert((int) s);719 assert((int) (p != NULL)); 720 assert((int) (s != NULL)); 721 721 722 722 /* sanity */ 723 723 if(s->type != type_CLIENT || s->state != state_STREAM) { -
sx/sasl.c
66 66 unsigned ulen) { 67 67 const char *realm = NULL; 68 68 char *c; 69 int ret;70 69 const struct propval *to_fetch, *current; 71 70 char *user_buf = NULL; 72 71 char *value; … … 1008 1007 sasl_security_properties_t sec_props; 1009 1008 nad_t nad; 1010 1009 1011 assert((int) p);1012 assert((int) s);1013 assert((int) appname);1014 assert((int) mech);1010 assert((int) (p != NULL)); 1011 assert((int) (s != NULL)); 1012 assert((int) (appname != NULL)); 1013 assert((int) (mech != NULL)); 1015 1014 1016 1015 if(s->type != type_CLIENT || s->state != state_STREAM) { 1017 1016 _sx_debug(ZONE, "need client in stream state for sasl auth"); -
sx/server.c
227 227 void sx_server_init(sx_t s, unsigned int flags) { 228 228 int i; 229 229 230 assert((int) s);230 assert((int) (s != NULL)); 231 231 232 232 /* can't do anything if we're alive already */ 233 233 if(s->state != state_NONE) -
sx/io.c
96 96 97 97 nad_print(nad, 0, &xml, &xlen); 98 98 errstring = (char *) malloc(sizeof(char) * (xlen + 1)); 99 sprintf(errstring, "%.*s", &xlen, &xml);99 sprintf(errstring, "%.*s", xlen, xml); 100 100 } 101 101 102 102 if(s->state < state_CLOSING) { … … 160 160 sx_buf_t in, out; 161 161 int read, ret; 162 162 163 assert((int) s);163 assert((int) (s != NULL)); 164 164 165 165 /* do we care? */ 166 166 if(!s->want_read && s->state < state_CLOSING) … … 294 294 sx_buf_t out; 295 295 int ret, written; 296 296 297 assert((int) s);297 assert((int) (s != NULL)); 298 298 299 299 /* do we care? */ 300 300 if(!s->want_write && s->state < state_CLOSING) … … 391 391 392 392 /** app version */ 393 393 void sx_nad_write_elem(sx_t s, nad_t nad, int elem) { 394 assert((int) s);395 assert((int) nad);394 assert((int) (s != NULL)); 395 assert((int) (nad != NULL)); 396 396 397 397 if(_sx_nad_write(s, nad, elem) == 1) 398 398 return; … … 425 425 426 426 /** app version */ 427 427 void sx_raw_write(sx_t s, char *buf, int len) { 428 assert((int) s);429 assert((int) buf);428 assert((int) (s != NULL)); 429 assert((int) (buf != NULL)); 430 430 assert(len); 431 431 432 432 if(_sx_raw_write(s, buf, len) == 1) … … 451 451 } 452 452 453 453 void sx_close(sx_t s) { 454 assert((int) s);454 assert((int) (s != NULL)); 455 455 456 456 if(s->state >= state_CLOSING) 457 457 return; … … 466 466 } 467 467 468 468 void sx_kill(sx_t s) { 469 assert((int) s);469 assert((int) (s != NULL)); 470 470 471 471 _sx_state(s, state_CLOSED); 472 472 _sx_event(s, event_CLOSED, NULL); -
sx/client.c
113 113 char *c; 114 114 int i, len; 115 115 116 assert((int) s);116 assert((int) (s != NULL)); 117 117 118 118 /* can't do anything if we're alive already */ 119 119 if(s->state != state_NONE) -
sx/env.c
32 32 void sx_env_free(sx_env_t env) { 33 33 int i; 34 34 35 assert((int) env);35 assert((int) (env != NULL)); 36 36 37 37 /* !!! usage counts */ 38 38 … … 51 51 int ret; 52 52 va_list args; 53 53 54 assert((int) env);55 assert((int) init);54 assert((int) (env != NULL)); 55 assert((int) (init != NULL)); 56 56 57 57 va_start(args, init); 58 58 -
sx/sx.c
24 24 sx_t s; 25 25 int i; 26 26 27 assert((int) cb);27 assert((int) (cb != NULL)); 28 28 29 29 s = (sx_t) malloc(sizeof(struct _sx_st)); 30 30 memset(s, 0, sizeof(struct _sx_st)); … … 129 129 130 130 /** force advance into auth state */ 131 131 void sx_auth(sx_t s, const char *auth_method, const char *auth_id) { 132 assert((int) s);132 assert((int) (s != NULL)); 133 133 134 134 _sx_debug(ZONE, "authenticating stream (method=%s; id=%s)", auth_method, auth_id); 135 135 -
router/router.c
858 858 /* they did something */ 859 859 comp->last_activity = time(NULL); 860 860 861 ioctl(fd , FIONREAD, &nbytes);861 ioctl(fd->fd, FIONREAD, &nbytes); 862 862 if(nbytes == 0) { 863 863 sx_kill(comp->s); 864 864 return 0; -
router/router.h
206 206 int user_table_load(router_t r); 207 207 void user_table_unload(router_t r); 208 208 209 int filter_load(router_t r); 210 void filter_unload(router_t r); 211 int filter_packet(router_t r, nad_t nad); 212 209 213 /* union for xhash_iter_get to comply with strict-alias rules for gcc3 */ 210 214 union xhashv 211 215 { -
mio/mio_impl.h
128 128 { 129 129 struct sockaddr_storage serv_addr; 130 130 socklen_t addrlen = (socklen_t) sizeof(serv_addr); 131 int newfd , dupfd;131 int newfd; 132 132 mio_fd_t mio_fd; 133 133 char ip[INET6_ADDRSTRLEN]; 134 134 -
util/jqueue.c
35 35 } 36 36 37 37 void jqueue_free(jqueue_t q) { 38 assert((int) q);38 assert((int) (q != NULL)); 39 39 40 40 pool_free(q->p); 41 41 } … … 43 43 void jqueue_push(jqueue_t q, void *data, int priority) { 44 44 _jqueue_node_t qn, scan; 45 45 46 assert((int) q);46 assert((int) (q != NULL)); 47 47 48 48 q->size++; 49 49 … … 96 96 void *data; 97 97 _jqueue_node_t qn; 98 98 99 assert((int) q);99 assert((int) (q != NULL)); 100 100 101 101 if(q->front == NULL) 102 102 return NULL; -
util/stanza.c
24 24 nad_t stanza_error(nad_t nad, int elem, int err) { 25 25 int ns; 26 26 27 assert((int) nad);27 assert((int) (nad != NULL)); 28 28 assert((int) (elem >= 0)); 29 29 assert((int) (err >= stanza_err_BAD_REQUEST && err < stanza_err_LAST)); 30 30 … … 51 51 int attr; 52 52 char to[3072], from[3072]; 53 53 54 assert((int) nad);54 assert((int) (nad != NULL)); 55 55 56 56 to[0] = '\0'; 57 57 from[0] = '\0'; -
util/xdata.c
49 49 xdata_field_t xdata_field_new(xdata_t xd, xdata_field_type_t type, char *var, char *label, char *desc, int required) { 50 50 xdata_field_t xdf; 51 51 52 assert((int) xd);52 assert((int) (xd != NULL)); 53 53 assert((int) type); 54 assert((int) var);54 assert((int) (var != NULL)); 55 55 56 56 xdf = pmalloco(xd->p, sizeof(struct _xdata_field_st)); 57 57 … … 73 73 xdata_item_t xdata_item_new(xdata_t xd) { 74 74 xdata_item_t xdi; 75 75 76 assert((int) xd);76 assert((int) (xd != NULL)); 77 77 78 78 xdi = pmalloco(xd->p, sizeof(struct _xdata_item_st)); 79 79 … … 84 84 85 85 /** field insertion */ 86 86 void xdata_add_field(xdata_t xd, xdata_field_t xdf) { 87 assert((int) xd);88 assert((int) xdf);87 assert((int) (xd != NULL)); 88 assert((int) (xdf != NULL)); 89 89 90 90 if(xd->fields == NULL) 91 91 xd->fields = xd->flast = xdf; … … 96 96 } 97 97 98 98 void xdata_add_rfield(xdata_t xd, xdata_field_t xdf) { 99 assert((int) xd);100 assert((int) xdf);99 assert((int) (xd != NULL)); 100 assert((int) (xdf != NULL)); 101 101 102 102 if(xd->rfields == NULL) 103 103 xd->rfields = xd->rflast = xdf; … … 108 108 } 109 109 110 110 void xdata_add_field_item(xdata_item_t xdi, xdata_field_t xdf) { 111 assert((int) xdi);112 assert((int) xdf);111 assert((int) (xdi != NULL)); 112 assert((int) (xdf != NULL)); 113 113 114 114 if(xdi->fields == NULL) 115 115 xdi->fields = xdi->flast = xdf; … … 121 121 122 122 /** item insertion */ 123 123 void xdata_add_item(xdata_t xd, xdata_item_t xdi) { 124 assert((int) xd);125 assert((int) xdi);124 assert((int) (xd != NULL)); 125 assert((int) (xdi != NULL)); 126 126 127 127 if(xd->items == NULL) 128 128 xd->items = xd->ilast = xdi; … … 136 136 void xdata_option_new(xdata_field_t xdf, char *value, int lvalue, char *label, int llabel) { 137 137 xdata_option_t xdo; 138 138 139 assert((int) xdf);140 assert((int) value);139 assert((int) (xdf != NULL)); 140 assert((int) (value != NULL)); 141 141 142 142 xdo = pmalloco(xdf->p, sizeof(struct _xdata_option_st)); 143 143 … … 160 160 void xdata_add_value(xdata_field_t xdf, char *value, int vlen) { 161 161 int first = 0; 162 162 163 assert((int) xdf);164 assert((int) value);163 assert((int) (xdf != NULL)); 164 assert((int) (value != NULL)); 165 165 166 166 if(vlen <= 0) vlen = strlen(value); 167 167 … … 271 271 int atype, elem, field; 272 272 xdata_field_t xdf; 273 273 274 assert((int) nad);274 assert((int) (nad != NULL)); 275 275 assert((int) (root >= 0)); 276 276 277 277 log_debug(ZONE, "building xd from nad"); -
util/jid.c
216 216 prep_cache_t pc; 217 217 unsigned char *myid, *cur, *olddata=NULL; 218 218 219 assert((int) jid);219 assert((int) (jid != NULL)); 220 220 221 221 pc = jid->pc; 222 222 if (jid->jid_data != NULL) { … … 308 308 int dataStatic; 309 309 jid_static_buf staticTmpBuf; 310 310 311 assert((int) jid);311 assert((int) (jid != NULL)); 312 312 313 313 pc = jid->pc; 314 314 if(jid->jid_data != NULL) -
util/datetime.c
38 38 struct timeval tv; 39 39 struct timezone tz; 40 40 41 assert((int) date);41 assert((int) (date != NULL)); 42 42 43 43 /* !!! sucks having to call this each time */ 44 44 tzset(); … … 115 115 struct tm *gmt; 116 116 117 117 assert((int) type); 118 assert((int) date);118 assert((int) (date != NULL)); 119 119 assert((int) datelen); 120 120 121 121 gmt = gmtime(&t);
