comparison src/protocols/oscar/oscar.c @ 4200:c8fb43808a4b

[gaim-migrate @ 4431] I try to look at it like this: At least now I know a little more about va_args. So when you pass stuff through "...", gcc promotes the argument to an integer. So passing fu16_t because 4 bytes instead of 2. Then when using va_args, you have to use a type that is 4 bytes instead of 2. I guess va_args is different in gcc 2, in that, if you give it a 2 byte type, it will get 4 bytes anyway. Either that, or gcc2 doesn't promote stuff to 4 bytes when passed through .... Anyway, sorry to all gcc3.x users. This patch just fixes a little bit of whitespace stuff, again, for no real reason. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sat, 04 Jan 2003 19:41:07 +0000
parents 97de60e7b7ba
children 511c2b63caa4
comparison
equal deleted inserted replaced
4199:97de60e7b7ba 4200:c8fb43808a4b
1001 fu32_t offset, len; 1001 fu32_t offset, len;
1002 char *modname; 1002 char *modname;
1003 int fd; 1003 int fd;
1004 1004
1005 va_start(ap, fr); 1005 va_start(ap, fr);
1006 offset = (fu32_t)va_arg(ap, unsigned long); 1006 offset = va_arg(ap, fu32_t);
1007 len = (fu32_t)va_arg(ap, unsigned long); 1007 len = va_arg(ap, fu32_t);
1008 modname = va_arg(ap, char *); 1008 modname = va_arg(ap, char *);
1009 va_end(ap); 1009 va_end(ap);
1010 1010
1011 debug_printf("offset: %lu, len: %lu, file: %s\n", offset, len, (modname ? modname : "aim.exe")); 1011 debug_printf("offset: %lu, len: %lu, file: %s\n", offset, len, (modname ? modname : "aim.exe"));
1012 if (len == 0) { 1012 if (len == 0) {
2192 2192
2193 return 1; 2193 return 1;
2194 } 2194 }
2195 2195
2196 static int gaim_parse_incoming_im(aim_session_t *sess, aim_frame_t *fr, ...) { 2196 static int gaim_parse_incoming_im(aim_session_t *sess, aim_frame_t *fr, ...) {
2197 int channel, ret = 0; 2197 fu16_t channel;
2198 int ret = 0;
2198 aim_userinfo_t *userinfo; 2199 aim_userinfo_t *userinfo;
2199 va_list ap; 2200 va_list ap;
2200 2201
2201 va_start(ap, fr); 2202 va_start(ap, fr);
2202 channel = va_arg(ap, int); 2203 channel = (fu16_t)va_arg(ap, unsigned int);
2203 userinfo = va_arg(ap, aim_userinfo_t *); 2204 userinfo = va_arg(ap, aim_userinfo_t *);
2204 2205
2205 switch (channel) { 2206 switch (channel) {
2206 case 1: { /* standard message */ 2207 case 1: { /* standard message */
2207 struct aim_incomingim_ch1_args *args; 2208 struct aim_incomingim_ch1_args *args;
2236 fu16_t chan, nummissed, reason; 2237 fu16_t chan, nummissed, reason;
2237 aim_userinfo_t *userinfo; 2238 aim_userinfo_t *userinfo;
2238 char buf[1024]; 2239 char buf[1024];
2239 2240
2240 va_start(ap, fr); 2241 va_start(ap, fr);
2241 chan = (fu16_t)va_arg(ap, unsigned int); 2242 chan = (fu16_t)va_arg(ap, unsigned int);
2242 userinfo = va_arg(ap, aim_userinfo_t *); 2243 userinfo = va_arg(ap, aim_userinfo_t *);
2243 nummissed = (fu16_t)va_arg(ap, unsigned int); 2244 nummissed = (fu16_t)va_arg(ap, unsigned int);
2244 reason = (fu16_t)va_arg(ap, unsigned int); 2245 reason = (fu16_t)va_arg(ap, unsigned int);
2245 va_end(ap); 2246 va_end(ap);
2246 2247
2247 switch(reason) { 2248 switch(reason) {
2248 case 0: 2249 case 0:
2249 /* Invalid (0) */ 2250 /* Invalid (0) */
2405 va_list ap; 2406 va_list ap;
2406 fu16_t chan, reason; 2407 fu16_t chan, reason;
2407 char *who; 2408 char *who;
2408 2409
2409 va_start(ap, fr); 2410 va_start(ap, fr);
2410 chan = (fu16_t) va_arg(ap, unsigned int); 2411 chan = (fu16_t)va_arg(ap, unsigned int);
2411 who = va_arg(ap, char *); 2412 who = va_arg(ap, char *);
2412 reason = (fu16_t) va_arg(ap, unsigned int); 2413 reason = (fu16_t)va_arg(ap, unsigned int);
2413 2414
2414 if (chan == 0x0002) { /* File transfer declined */ 2415 if (chan == 0x0002) { /* File transfer declined */
2415 char *cookie = va_arg(ap, char *); 2416 char *cookie = va_arg(ap, char *);
2416 return gaim_parse_clientauto_ch2(sess, who, reason, cookie); 2417 return gaim_parse_clientauto_ch2(sess, who, reason, cookie);
2417 } else if (chan == 0x0004) { /* ICQ message */ 2418 } else if (chan == 0x0004) { /* ICQ message */
2418 int state = 0; 2419 fu32_t state = 0;
2419 char *msg = NULL; 2420 char *msg = NULL;
2420 if (reason == 0x0003) { 2421 if (reason == 0x0003) {
2421 state = (int) va_arg(ap, fu32_t); 2422 state = va_arg(ap, fu32_t);
2422 msg = va_arg(ap, char *); 2423 msg = va_arg(ap, char *);
2423 } 2424 }
2424 return gaim_parse_clientauto_ch4(sess, who, reason, state, msg); 2425 return gaim_parse_clientauto_ch4(sess, who, reason, state, msg);
2425 } 2426 }
2426 2427
2808 fu16_t instance, flags, maxmsglen, maxoccupancy, unknown, exchange; 2809 fu16_t instance, flags, maxmsglen, maxoccupancy, unknown, exchange;
2809 fu8_t createperms; 2810 fu8_t createperms;
2810 fu32_t createtime; 2811 fu32_t createtime;
2811 2812
2812 fqcn = va_arg(ap, char *); 2813 fqcn = va_arg(ap, char *);
2813 instance = (fu16_t)va_arg(ap, unsigned int); 2814 instance = (fu16_t)va_arg(ap, unsigned int);
2814 exchange = (fu16_t)va_arg(ap, unsigned int); 2815 exchange = (fu16_t)va_arg(ap, unsigned int);
2815 flags = (fu16_t)va_arg(ap, unsigned int); 2816 flags = (fu16_t)va_arg(ap, unsigned int);
2816 createtime = va_arg(ap, fu32_t); 2817 createtime = va_arg(ap, fu32_t);
2817 maxmsglen = (fu16_t)va_arg(ap, unsigned int); 2818 maxmsglen = (fu16_t)va_arg(ap, unsigned int);
2818 maxoccupancy = (fu16_t)va_arg(ap, unsigned int); 2819 maxoccupancy = (fu16_t)va_arg(ap, unsigned int);
2819 createperms = (fu8_t)va_arg(ap, int); 2820 createperms = (fu8_t)va_arg(ap, unsigned int);
2820 unknown = (fu16_t)va_arg(ap, unsigned int); 2821 unknown = (fu16_t)va_arg(ap, unsigned int);
2821 name = va_arg(ap, char *); 2822 name = va_arg(ap, char *);
2822 ck = va_arg(ap, char *); 2823 ck = va_arg(ap, char *);
2823 /* va_end(ap); */
2824 2824
2825 debug_printf("created room: %s %hu %hu %hu %lu %hu %hu %hhu %hu %s %s\n", 2825 debug_printf("created room: %s %hu %hu %hu %lu %hu %hu %hhu %hu %s %s\n",
2826 fqcn, 2826 fqcn,
2827 exchange, instance, flags, 2827 exchange, instance, flags,
2828 createtime, 2828 createtime,
2903 roominfo = va_arg(ap, struct aim_chat_roominfo *); 2903 roominfo = va_arg(ap, struct aim_chat_roominfo *);
2904 roomname = va_arg(ap, char *); 2904 roomname = va_arg(ap, char *);
2905 usercount= va_arg(ap, int); 2905 usercount= va_arg(ap, int);
2906 userinfo = va_arg(ap, aim_userinfo_t *); 2906 userinfo = va_arg(ap, aim_userinfo_t *);
2907 roomdesc = va_arg(ap, char *); 2907 roomdesc = va_arg(ap, char *);
2908 unknown_c9 = (fu16_t)va_arg(ap, int); 2908 unknown_c9 = (fu16_t)va_arg(ap, unsigned int);
2909 creationtime = (fu32_t)va_arg(ap, unsigned long); 2909 creationtime = va_arg(ap, fu32_t);
2910 maxmsglen = (fu16_t)va_arg(ap, int); 2910 maxmsglen = (fu16_t)va_arg(ap, unsigned int);
2911 unknown_d2 = (fu16_t)va_arg(ap, int); 2911 unknown_d2 = (fu16_t)va_arg(ap, unsigned int);
2912 unknown_d5 = (fu16_t)va_arg(ap, int); 2912 unknown_d5 = (fu16_t)va_arg(ap, unsigned int);
2913 maxvisiblemsglen = (fu16_t)va_arg(ap, int); 2913 maxvisiblemsglen = (fu16_t)va_arg(ap, unsigned int);
2914 va_end(ap); 2914 va_end(ap);
2915 2915
2916 debug_printf("inside chat_info_update (maxmsglen = %hu, maxvislen = %hu)\n", 2916 debug_printf("inside chat_info_update (maxmsglen = %hu, maxvislen = %hu)\n",
2917 maxmsglen, maxvisiblemsglen); 2917 maxmsglen, maxvisiblemsglen);
2918 2918
2995 va_list ap; 2995 va_list ap;
2996 fu16_t code, rateclass; 2996 fu16_t code, rateclass;
2997 fu32_t windowsize, clear, alert, limit, disconnect, currentavg, maxavg; 2997 fu32_t windowsize, clear, alert, limit, disconnect, currentavg, maxavg;
2998 2998
2999 va_start(ap, fr); 2999 va_start(ap, fr);
3000 code = (fu16_t)va_arg(ap, unsigned int); 3000 code = (fu16_t)va_arg(ap, unsigned int);
3001 rateclass= (fu16_t)va_arg(ap, unsigned int); 3001 rateclass= (fu16_t)va_arg(ap, unsigned int);
3002 windowsize = (fu32_t)va_arg(ap, unsigned long); 3002 windowsize = va_arg(ap, fu32_t);
3003 clear = (fu32_t)va_arg(ap, unsigned long); 3003 clear = va_arg(ap, fu32_t);
3004 alert = (fu32_t)va_arg(ap, unsigned long); 3004 alert = va_arg(ap, fu32_t);
3005 limit = (fu32_t)va_arg(ap, unsigned long); 3005 limit = va_arg(ap, fu32_t);
3006 disconnect = (fu32_t)va_arg(ap, unsigned long); 3006 disconnect = va_arg(ap, fu32_t);
3007 currentavg = (fu32_t)va_arg(ap, unsigned long); 3007 currentavg = va_arg(ap, fu32_t);
3008 maxavg = (fu32_t)va_arg(ap, unsigned long); 3008 maxavg = va_arg(ap, fu32_t);
3009 va_end(ap); 3009 va_end(ap);
3010 3010
3011 debug_printf("rate %s (param ID 0x%04hx): curavg = %lu, maxavg = %lu, alert at %lu, " 3011 debug_printf("rate %s (param ID 0x%04hx): curavg = %lu, maxavg = %lu, alert at %lu, "
3012 "clear warning at %lu, limit at %lu, disconnect at %lu (window size = %lu)\n", 3012 "clear warning at %lu, limit at %lu, disconnect at %lu (window size = %lu)\n",
3013 (code < 5) ? codes[code] : codes[0], 3013 (code < 5) ? codes[code] : codes[0],