Changeset 4d86e06
- Timestamp:
- Jul 23, 2009, 12:53:57 AM (16 years ago)
- Branches:
- master, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- ba6c8bd
- Parents:
- 029a8b5
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
aim.c
r029a8b5 r4d86e06 346 346 aim_conn_t *cur; 347 347 /* 348 OscarData *od = (OscarData *)g->proto_data;348 OscarData *od = g->proto_data; 349 349 char *name, *exchange; 350 350 */ … … 429 429 430 430 aimsess=owl_global_get_aimsess(&g); 431 priv = (struct owlfaim_priv *)aimsess->aux_data;431 priv = aimsess->aux_data; 432 432 433 433 /* do a select without blocking */ … … 479 479 static int faimtest_parse_login(aim_session_t *sess, aim_frame_t *fr, ...) 480 480 { 481 struct owlfaim_priv *priv = (struct owlfaim_priv *)sess->aux_data;481 struct owlfaim_priv *priv = sess->aux_data; 482 482 struct client_info_s info = CLIENTINFO_AIM_KNOWNGOOD; 483 483 … … 703 703 static int faimtest_parse_connerr(aim_session_t *sess, aim_frame_t *fr, ...) 704 704 { 705 struct owlfaim_priv *priv = (struct owlfaim_priv *)sess->aux_data;705 struct owlfaim_priv *priv = sess->aux_data; 706 706 va_list ap; 707 707 fu16_t code; … … 879 879 static int faimtest_reportinterval(aim_session_t *sess, aim_frame_t *fr, ...) 880 880 { 881 struct owlfaim_priv *priv = (struct owlfaim_priv *)sess->aux_data;881 struct owlfaim_priv *priv = sess->aux_data; 882 882 va_list ap; 883 883 fu16_t interval; … … 944 944 static int getaimdata(aim_session_t *sess, unsigned char **bufret, int *buflenret, unsigned long offset, unsigned long len, const char *modname) 945 945 { 946 struct owlfaim_priv *priv = (struct owlfaim_priv *)sess->aux_data;946 struct owlfaim_priv *priv = sess->aux_data; 947 947 FILE *f; 948 948 static const char defaultmod[] = "aim.exe"; … … 1069 1069 static int faimtest_memrequest(aim_session_t *sess, aim_frame_t *fr, ...) 1070 1070 { 1071 struct owlfaim_priv *priv = (struct owlfaim_priv *)sess->aux_data;1071 struct owlfaim_priv *priv = sess->aux_data; 1072 1072 va_list ap; 1073 1073 fu32_t offset, len; … … 1168 1168 static int faimtest_parse_incoming_im_chan1(aim_session_t *sess, aim_conn_t *conn, aim_userinfo_t *userinfo, struct aim_incomingim_ch1_args *args) 1169 1169 { 1170 struct owlfaim_priv *priv = (struct owlfaim_priv *)sess->aux_data;1170 struct owlfaim_priv *priv = sess->aux_data; 1171 1171 owl_message *m; 1172 1172 char *stripmsg, *nz_screenname, *wrapmsg; -
cmd.c
rd43edd2 r4d86e06 39 39 40 40 owl_cmd *owl_cmddict_find(owl_cmddict *d, char *name) { 41 return (owl_cmd*)owl_dict_find_element(d, name);41 return owl_dict_find_element(d, name); 42 42 } 43 43 … … 51 51 cmd = owl_malloc(sizeof(owl_cmd)); 52 52 owl_cmd_create_alias(cmd, alias_from, alias_to); 53 owl_dict_insert_element(cd, cmd->name, (void*)cmd, (void(*)(void*))owl_cmd_free);53 owl_dict_insert_element(cd, cmd->name, cmd, (void(*)(void*))owl_cmd_free); 54 54 return(0); 55 55 } … … 62 62 } 63 63 owl_perlconfig_new_command(cmd->name); 64 return owl_dict_insert_element(cd, newcmd->name, (void*)newcmd, (void(*)(void*))owl_cmd_free);64 return owl_dict_insert_element(cd, newcmd->name, newcmd, (void(*)(void*))owl_cmd_free); 65 65 } 66 66 … … 70 70 71 71 if (!strcmp(argv[0], "")) { 72 } else if (NULL != (cmd = (owl_cmd*)owl_dict_find_element(cd, argv[0]))) {72 } else if (NULL != (cmd = owl_dict_find_element(cd, argv[0]))) { 73 73 retval = owl_cmd_execute(cmd, cd, ctx, argc, argv, buff); 74 74 } else { -
commands.c
rd43edd2 r4d86e06 2439 2439 i--; /* Accept 1-based indexing */ 2440 2440 if(i < owl_list_get_size(fl)) { 2441 f = (owl_filter*)owl_list_get_element(fl, i);2441 f = owl_list_get_element(fl, i); 2442 2442 owl_list_remove_element(fl, i); 2443 2443 owl_filter_free(f); -
context.c
rd43edd2 r4d86e06 70 70 void owl_context_set_popless(owl_context *ctx, owl_viewwin *vw) 71 71 { 72 ctx->data = (void*)vw;72 ctx->data = vw; 73 73 SET_ACTIVE(ctx, OWL_CTX_POPLESS); 74 74 } … … 81 81 void owl_context_set_editmulti(owl_context *ctx, owl_editwin *ew) 82 82 { 83 ctx->data = (void*)ew;83 ctx->data = ew; 84 84 SET_ACTIVE(ctx, OWL_CTX_EDITMULTI); 85 85 } … … 87 87 void owl_context_set_editline(owl_context *ctx, owl_editwin *ew) 88 88 { 89 ctx->data = (void*)ew;89 ctx->data = ew; 90 90 SET_ACTIVE(ctx, OWL_CTX_EDITLINE); 91 91 } … … 93 93 void owl_context_set_editresponse(owl_context *ctx, owl_editwin *ew) 94 94 { 95 ctx->data = (void*)ew;95 ctx->data = ew; 96 96 SET_ACTIVE(ctx, OWL_CTX_EDITRESPONSE); 97 97 } -
dict.c
rd43edd2 r4d86e06 18 18 int owl_dict_create(owl_dict *d) { 19 19 d->size=0; 20 d->els= (owl_dict_el *)owl_malloc(INITSIZE*sizeof(owl_dict_el));20 d->els=owl_malloc(INITSIZE*sizeof(owl_dict_el)); 21 21 d->avail=INITSIZE; 22 22 if (d->els==NULL) return(-1); … … 61 61 for (i=0; i<d->size; i++) { 62 62 if ((dupk = owl_strdup(d->els[i].k)) == NULL) return(-1); 63 owl_list_append_element(l, (void*)dupk);63 owl_list_append_element(l, dupk); 64 64 } 65 65 return(0); … … 95 95 if (pos!=d->size) { 96 96 /* shift forward to leave us a slot */ 97 memmove( (void*)(d->els+pos+1), (void*)(d->els+pos),97 memmove(d->els+pos+1, d->els+pos, 98 98 sizeof(owl_dict_el)*(d->size-pos)); 99 99 } … … 152 152 printf("# BEGIN testing owl_dict\n"); 153 153 FAIL_UNLESS("create", 0==owl_dict_create(&d)); 154 FAIL_UNLESS("insert b", 0==owl_dict_insert_element(&d, "b", (void*)bv, owl_dict_noop_free));155 FAIL_UNLESS("insert d", 0==owl_dict_insert_element(&d, "d", (void*)dv, owl_dict_noop_free));156 FAIL_UNLESS("insert a", 0==owl_dict_insert_element(&d, "a", (void*)av, owl_dict_noop_free));157 FAIL_UNLESS("insert c", 0==owl_dict_insert_element(&d, "c", (void*)cv, owl_dict_noop_free));158 FAIL_UNLESS("reinsert d (no replace)", -2==owl_dict_insert_element(&d, "d", (void*)dv, 0));159 FAIL_UNLESS("find a", (void*)av==owl_dict_find_element(&d, "a"));160 FAIL_UNLESS("find b", (void*)bv==owl_dict_find_element(&d, "b"));161 FAIL_UNLESS("find c", (void*)cv==owl_dict_find_element(&d, "c"));162 FAIL_UNLESS("find d", (void*)dv==owl_dict_find_element(&d, "d"));154 FAIL_UNLESS("insert b", 0==owl_dict_insert_element(&d, "b", bv, owl_dict_noop_free)); 155 FAIL_UNLESS("insert d", 0==owl_dict_insert_element(&d, "d", dv, owl_dict_noop_free)); 156 FAIL_UNLESS("insert a", 0==owl_dict_insert_element(&d, "a", av, owl_dict_noop_free)); 157 FAIL_UNLESS("insert c", 0==owl_dict_insert_element(&d, "c", cv, owl_dict_noop_free)); 158 FAIL_UNLESS("reinsert d (no replace)", -2==owl_dict_insert_element(&d, "d", dv, 0)); 159 FAIL_UNLESS("find a", av==owl_dict_find_element(&d, "a")); 160 FAIL_UNLESS("find b", bv==owl_dict_find_element(&d, "b")); 161 FAIL_UNLESS("find c", cv==owl_dict_find_element(&d, "c")); 162 FAIL_UNLESS("find d", dv==owl_dict_find_element(&d, "d")); 163 163 FAIL_UNLESS("find e (non-existent)", NULL==owl_dict_find_element(&d, "e")); 164 FAIL_UNLESS("remove d", (void*)dv==owl_dict_remove_element(&d, "d"));164 FAIL_UNLESS("remove d", dv==owl_dict_remove_element(&d, "d")); 165 165 FAIL_UNLESS("find d (post-removal)", NULL==owl_dict_find_element(&d, "d")); 166 166 -
fmtext.c
rd43edd2 r4d86e06 785 785 size = owl_list_get_size(l); 786 786 for (i=0; i<size; i++) { 787 elem = (char*)owl_list_get_element(l,i);787 elem = owl_list_get_element(l,i); 788 788 if (elem && format_fn) { 789 789 text = format_fn(elem); -
keymap.c
rd43edd2 r4d86e06 44 44 */ 45 45 for (i = owl_list_get_size(&km->bindings)-1; i>=0; i--) { 46 curkb = (owl_keybinding*)owl_list_get_element(&km->bindings, i);46 curkb = owl_list_get_element(&km->bindings, i); 47 47 if (owl_keybinding_equal(curkb, kb)) { 48 48 owl_list_remove_element(&km->bindings, i); … … 152 152 { 153 153 owl_keymap *km; 154 km = (owl_keymap*)owl_malloc(sizeof(owl_keymap));154 km = owl_malloc(sizeof(owl_keymap)); 155 155 if (!km) return NULL; 156 156 owl_keymap_init(km, name, desc, default_fn, prealways_fn, postalways_fn); … … 169 169 owl_keymap *owl_keyhandler_get_keymap(owl_keyhandler *kh, char *mapname) 170 170 { 171 return (owl_keymap*)owl_dict_find_element(&kh->keymaps, mapname);171 return owl_dict_find_element(&kh->keymaps, mapname); 172 172 } 173 173 … … 191 191 owl_keymap *km; 192 192 if (kh->active && !strcmp(mapname, kh->active->name)) return(kh->active); 193 km = (owl_keymap*)owl_dict_find_element(&kh->keymaps, mapname);193 km = owl_dict_find_element(&kh->keymaps, mapname); 194 194 if (!km) return(NULL); 195 195 owl_keyhandler_reset(kh); … … 240 240 for (km=kh->active; km; km=km->submap) { 241 241 for (i=owl_list_get_size(&km->bindings)-1; i>=0; i--) { 242 kb = (owl_keybinding*)owl_list_get_element(&km->bindings, i);242 kb = owl_list_get_element(&km->bindings, i); 243 243 match = owl_keybinding_match(kb, kh); 244 244 if (match == 1) { /* subset match */ -
list.c
rd43edd2 r4d86e06 8 8 { 9 9 l->size=0; 10 l->list= (void **)owl_malloc(INITSIZE*sizeof(void *));10 l->list=owl_malloc(INITSIZE*sizeof(void *)); 11 11 l->avail=INITSIZE; 12 12 if (l->list==NULL) return(-1); -
message.c
rd43edd2 r4d86e06 808 808 /* save the hostname */ 809 809 owl_function_debugmsg("About to do gethostbyaddr"); 810 hent=gethostbyaddr( (char *)&(n->z_uid.zuid_addr), sizeof(n->z_uid.zuid_addr), AF_INET);810 hent=gethostbyaddr(&(n->z_uid.zuid_addr), sizeof(n->z_uid.zuid_addr), AF_INET); 811 811 if (hent && hent->h_name) { 812 812 owl_message_set_hostname(m, hent->h_name); -
obarray.c
raf1920fd r4d86e06 25 25 while(first <= last) { 26 26 mid = first + (last - first)/2; 27 str = (char*)owl_list_get_element(&(oa->strings), mid);27 str = owl_list_get_element(&(oa->strings), mid); 28 28 cmp = strcmp(key, str); 29 29 if(cmp == 0) { -
owl.c
r0bf6757 r4d86e06 693 693 694 694 if (rfd<0) return; 695 if (-1 == ioctl(rfd, FIONREAD, (void*)&navail)) {695 if (-1 == ioctl(rfd, FIONREAD, &navail)) { 696 696 return; 697 697 } -
perlconfig.c
rd43edd2 r4d86e06 307 307 PERL_SYS_INIT3(Pargc, Pargv, Penv); 308 308 p=perl_alloc(); 309 owl_global_set_perlinterp(&g, (void*)p);309 owl_global_set_perlinterp(&g, p); 310 310 perl_construct(p); 311 311 … … 497 497 void owl_perlconfig_dispatch_free(owl_dispatch *d) 498 498 { 499 SvREFCNT_dec( (SV*)d->data);499 SvREFCNT_dec(d->data); 500 500 owl_free(d); 501 501 } … … 503 503 void owl_perlconfig_edit_callback(owl_editwin *e) 504 504 { 505 SV *cb = (SV*)owl_editwin_get_cbdata(e);505 SV *cb = owl_editwin_get_cbdata(e); 506 506 SV *text; 507 507 dSP; -
popexec.c
rd43edd2 r4d86e06 108 108 } 109 109 110 if (0 != (rv_navail = ioctl(d->fd, FIONREAD, (void*)&navail))) {110 if (0 != (rv_navail = ioctl(d->fd, FIONREAD, &navail))) { 111 111 owl_function_debugmsg("ioctl error"); 112 112 } … … 160 160 void owl_popexec_viewwin_onclose(owl_viewwin *vwin, void *data) 161 161 { 162 owl_popexec *pe = (owl_popexec*)data;162 owl_popexec *pe = data; 163 163 int status, rv; 164 164 -
select.c
rd43edd2 r4d86e06 90 90 len = owl_list_get_size(dl); 91 91 for(i = 0; i < len; i++) { 92 d = (owl_dispatch*)owl_list_get_element(dl, i);92 d = owl_list_get_element(dl, i); 93 93 if (d->fd == fd) return i; 94 94 } … … 102 102 103 103 dl = owl_global_get_dispatchlist(&g); 104 d = (owl_dispatch*)owl_list_get_element(dl, elt);104 d = owl_list_get_element(dl, elt); 105 105 owl_list_remove_element(dl, elt); 106 106 if (d->destroy) { … … 122 122 if (elt != -1) { /* If we have a dispatch for this FD */ 123 123 owl_dispatch *d_old; 124 d_old = (owl_dispatch*)owl_list_get_element(dl, elt);124 d_old = owl_list_get_element(dl, elt); 125 125 /* Ignore if we're adding the same dispatch again. Otherwise 126 126 replace the old dispatch. */ … … 145 145 /* Defer the removal until dispatch is done walking the list */ 146 146 dl = owl_global_get_dispatchlist(&g); 147 d = (owl_dispatch*)owl_list_get_element(dl, elt);147 d = owl_list_get_element(dl, elt); 148 148 d->needs_gc = 1; 149 149 } else { … … 163 163 elt = owl_select_find_dispatch(fd); 164 164 if (elt != -1) { 165 d = (owl_dispatch*)owl_list_get_element(owl_global_get_dispatchlist(&g), elt);165 d = owl_list_get_element(owl_global_get_dispatchlist(&g), elt); 166 166 if (d->cfunc != owl_perlconfig_dispatch) { 167 167 /* don't mess with non-perl dispatch functions from here. */ … … 186 186 elt = owl_select_find_dispatch(fd); 187 187 if (elt != -1) { 188 d = (owl_dispatch*)owl_list_get_element(owl_global_get_dispatchlist(&g), elt);188 d = owl_list_get_element(owl_global_get_dispatchlist(&g), elt); 189 189 if (d->cfunc == owl_perlconfig_dispatch) { 190 190 owl_select_remove_dispatch_at(elt); … … 207 207 len = owl_select_dispatch_count(g); 208 208 for(i = 0; i < len; i++) { 209 d = (owl_dispatch*)owl_list_get_element(dl, i);209 d = owl_list_get_element(dl, i); 210 210 FD_SET(d->fd, r); 211 211 FD_SET(d->fd, e); … … 245 245 246 246 for(i = 0; i < len; i++) { 247 d = (owl_dispatch*)owl_list_get_element(dl, i);247 d = owl_list_get_element(dl, i); 248 248 /* While d shouldn't normally be null, the list may be altered by 249 249 * functions we dispatch to. */ -
util.c
rd43edd2 r4d86e06 139 139 if (first) { 140 140 first=0; 141 foo= (char *)strtok(workbuff, sep);141 foo=strtok(workbuff, sep); 142 142 } else { 143 foo= (char *)strtok(NULL, sep);143 foo=strtok(NULL, sep); 144 144 } 145 145 if (foo==NULL) { 146 146 done=1; 147 147 } else { 148 args= (char **)owl_realloc(args, sizeof(char *) * (count+1));148 args=owl_realloc(args, sizeof(char *) * (count+1)); 149 149 args[count]=owl_malloc(strlen(foo)+1); 150 150 strcpy(args[count], foo); -
variable.c
rd43edd2 r4d86e06 521 521 return(-2); 522 522 } 523 owl_dict_insert_element(vd, cur->name, (void*)cur, NULL);523 owl_dict_insert_element(vd, cur->name, cur, NULL); 524 524 } 525 525 return 0; … … 528 528 void owl_variable_dict_add_variable(owl_vardict * vardict, 529 529 owl_variable * var) { 530 owl_dict_insert_element(vardict, var->name, (void*)var, (void(*)(void*))owl_variable_free);530 owl_dict_insert_element(vardict, var->name, var, (void(*)(void*))owl_variable_free); 531 531 } 532 532 533 533 owl_variable * owl_variable_newvar(char *name, char *summary, char * description) { 534 owl_variable * var = (owl_variable*)owl_malloc(sizeof(owl_variable));534 owl_variable * var = owl_malloc(sizeof(owl_variable)); 535 535 memset(var, 0, sizeof(owl_variable)); 536 536 var->name = owl_strdup(name); … … 739 739 /* returns a reference */ 740 740 char *owl_variable_get_string(owl_vardict *d, char *name) { 741 return (char*)owl_variable_get(d,name, OWL_VARIABLE_STRING);741 return owl_variable_get(d,name, OWL_VARIABLE_STRING); 742 742 } 743 743 744 744 /* returns a reference */ 745 745 void *owl_variable_get_other(owl_vardict *d, char *name) { 746 return (char*)owl_variable_get(d,name, OWL_VARIABLE_OTHER);746 return owl_variable_get(d,name, OWL_VARIABLE_OTHER); 747 747 } 748 748 749 749 int owl_variable_get_int(owl_vardict *d, char *name) { 750 750 int *pi; 751 pi = (int*)owl_variable_get(d,name,OWL_VARIABLE_INT);751 pi = owl_variable_get(d,name,OWL_VARIABLE_INT); 752 752 if (!pi) return(-1); 753 753 return(*pi); … … 756 756 int owl_variable_get_bool(owl_vardict *d, char *name) { 757 757 int *pi; 758 pi = (int*)owl_variable_get(d,name,OWL_VARIABLE_BOOL);758 pi = owl_variable_get(d,name,OWL_VARIABLE_BOOL); 759 759 if (!pi) return(-1); 760 760 return(*pi); -
view.c
rd43edd2 r4d86e06 38 38 39 39 /* nuke the old list */ 40 owl_list_free_simple( (owl_list *) ml);40 owl_list_free_simple(&ml->list); 41 41 owl_messagelist_create(&(v->ml)); 42 42 … … 161 161 void owl_view_free(owl_view *v) 162 162 { 163 owl_list_free_simple( (owl_list *) &(v->ml));163 owl_list_free_simple(&v->ml.list); 164 164 if (v->name) owl_free(v->name); 165 165 } -
zcrypt.c
rd43edd2 r4d86e06 249 249 /* Prepare result to be returned */ 250 250 char *temp = keyfile; 251 keyfile = (char *)owl_malloc(strlen(temp) + 1);251 keyfile = owl_malloc(strlen(temp) + 1); 252 252 if (keyfile) { 253 253 strcpy(keyfile, temp); -
zephyr.c
rd43edd2 r4d86e06 42 42 } 43 43 44 (void) memset( (char *)&sin, 0, sizeof(struct sockaddr_in));44 (void) memset(&sin, 0, sizeof(struct sockaddr_in)); 45 45 46 46 sp = getservbyname(HM_SVCNAME, "udp"); … … 51 51 sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK); 52 52 53 (void) memset( (char *)&req, 0, sizeof(req));53 (void) memset(&req, 0, sizeof(req)); 54 54 req.z_kind = STAT; 55 55 req.z_port = 0; … … 278 278 279 279 /* add it to the list of subs */ 280 if ((tmp= (char *)strtok(start, ",\n\r"))==NULL) continue;280 if ((tmp=strtok(start, ",\n\r"))==NULL) continue; 281 281 subs[count].zsub_class=owl_strdup(tmp); 282 if ((tmp= (char *)strtok(NULL, ",\n\r"))==NULL) continue;282 if ((tmp=strtok(NULL, ",\n\r"))==NULL) continue; 283 283 subs[count].zsub_classinst=owl_strdup(tmp); 284 if ((tmp= (char *)strtok(NULL, " \t\n\r"))==NULL) continue;284 if ((tmp=strtok(NULL, " \t\n\r"))==NULL) continue; 285 285 subs[count].zsub_recipient=owl_strdup(tmp); 286 286
Note: See TracChangeset
for help on using the changeset viewer.