Changeset b041b52


Ignore:
Timestamp:
2011-12-06T21:50:43Z (12 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
aee8c19
Parents:
df98ee8 (diff), d7edadf (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merging compiler warning fixes from vmiklos.

This change also uncovered one bug in groupchat handling in OSCAR, which
I fixed during the merge.

Location:
protocols
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • protocols/msn/sb.c

    rdf98ee8 rb041b52  
    308308        struct msn_switchboard *sb = data;
    309309        struct im_connection *ic;
    310         struct msn_data *md;
    311310        char buf[1024];
    312311       
     
    316315       
    317316        ic = sb->ic;
    318         md = ic->proto_data;
    319317       
    320318        if( source != sb->fd )
     
    675673        struct im_connection *ic = sb->ic;
    676674        char *body;
    677         int blen = 0;
    678675       
    679676        if( !num_parts )
     
    681678       
    682679        if( ( body = strstr( msg, "\r\n\r\n" ) ) )
    683         {
    684680                body += 4;
    685                 blen = msglen - ( body - msg );
    686         }
    687681       
    688682        if( strcmp( cmd[0], "MSG" ) == 0 )
  • protocols/msn/soap.c

    rdf98ee8 rb041b52  
    210210{
    211211        char *s;
    212         int st;
    213212       
    214213        if( !getenv( "BITLBEE_DEBUG" ) )
     
    218217        {
    219218                if( ( s = strstr( headers, "\r\n\r\n" ) ) )
    220                         st = write( 2, headers, s - headers + 4 );
     219                        write( 2, headers, s - headers + 4 );
    221220                else
    222                         st = write( 2, headers, strlen( headers ) );
     221                        write( 2, headers, strlen( headers ) );
    223222        }
    224223       
  • protocols/oscar/chat.c

    rdf98ee8 rb041b52  
    384384        char *roomname = NULL;
    385385        struct aim_chat_roominfo roominfo;
    386         guint16 tlvcount = 0;
    387386        aim_tlvlist_t *tlvlist;
    388387        char *roomdesc = NULL;
     
    401400        }
    402401
    403         tlvcount = aimbs_get16(bs);
     402        aimbs_get16(bs); /* tlv count */
    404403
    405404        /*
  • protocols/oscar/chatnav.c

    rdf98ee8 rb041b52  
    139139                 * Type 0x0002: Unknown
    140140                 */
    141                 if (aim_gettlv(innerlist, 0x0002, 1)) {
    142                         guint16 classperms;
    143 
    144                         classperms = aim_gettlv16(innerlist, 0x0002, 1);
    145                        
    146                 }
     141                if (aim_gettlv(innerlist, 0x0002, 1))
     142                        ;
    147143
    148144                /*
     
    205201                 */
    206202                if (aim_gettlv(innerlist, 0x00d5, 1)) {
    207                         guint8 createperms;
    208 
    209                         createperms = aim_gettlv8(innerlist, 0x00d5, 1);
     203                        aim_gettlv8(innerlist, 0x00d5, 1); /* createperms */
    210204                }
    211205
  • protocols/oscar/icq.c

    rdf98ee8 rb041b52  
    235235        aim_tlv_t *datatlv;
    236236        aim_bstream_t qbs;
    237         guint32 ouruin;
    238         guint16 cmdlen, cmd, reqid;
     237        guint16 cmd, reqid;
    239238
    240239        if (!(tl = aim_readtlvchain(bs)) || !(datatlv = aim_gettlv(tl, 0x0001, 1))) {
     
    246245        aim_bstream_init(&qbs, datatlv->value, datatlv->length);
    247246
    248         cmdlen = aimbs_getle16(&qbs);
    249         ouruin = aimbs_getle32(&qbs);
     247        aimbs_getle16(&qbs); /* cmdlen */
     248        aimbs_getle32(&qbs); /* ouruin */
    250249        cmd = aimbs_getle16(&qbs);
    251250        reqid = aimbs_getle16(&qbs);
  • protocols/oscar/im.c

    rdf98ee8 rb041b52  
    919919        int i, ret = 0;
    920920        aim_rxcallback_t userfunc;
    921         guint8 cookie[8];
    922921        guint16 channel;
    923922        aim_tlvlist_t *tlvlist;
     
    931930        /* ICBM Cookie. */
    932931        for (i = 0; i < 8; i++)
    933                 cookie[i] = aimbs_get8(bs);
     932                aimbs_get8(bs);
    934933
    935934        /* Channel ID */
     
    14141413{
    14151414        guint16 hdrlen, msglen, dc;
    1416         guint8 msgtype, msgflags;
     1415        guint8 msgtype;
    14171416    guint8 *plugin;
    14181417    int i = 0, tmp = 0;
     
    14421441
    14431442        msgtype = aimbs_getle8(servdata);
    1444         msgflags = aimbs_getle8(servdata);
     1443        aimbs_getle8(servdata); /* msgflags */
    14451444
    14461445        aim_bstream_advance(servdata, 0x04); /* status code and priority code */
  • protocols/oscar/misc.c

    rdf98ee8 rb041b52  
    310310{
    311311        aim_frame_t *fr;
    312         aim_snacid_t snacid;
    313312        aim_tlvlist_t *tl = NULL;
    314313
     
    330329                return -ENOMEM;
    331330
    332         snacid = aim_cachesnac(sess, 0x0002, 0x000f, 0x0000, NULL, 0);
     331        aim_cachesnac(sess, 0x0002, 0x000f, 0x0000, NULL, 0);
    333332
    334333        aim_putsnac(&fr->data, 0x0002, 0x000f, 0x0000, 0);
  • protocols/oscar/oscar.c

    rdf98ee8 rb041b52  
    10721072static void gaim_icq_authgrant(void *data_) {
    10731073        struct icq_auth *data = data_;
    1074         char *uin, message;
     1074        char *uin;
    10751075        struct oscar_data *od = (struct oscar_data *)data->ic->proto_data;
    10761076       
    10771077        uin = g_strdup_printf("%u", data->uin);
    1078         message = 0;
    10791078        aim_ssi_auth_reply(od->sess, od->conn, uin, 1, "");
     1079        // char *message = 0;
    10801080        // aim_send_im_ch4(od->sess, uin, AIM_ICQMSG_AUTHGRANTED, &message);
    10811081        imcb_ask_add(data->ic, uin, NULL);
     
    12191219static int gaim_parse_misses(aim_session_t *sess, aim_frame_t *fr, ...) {
    12201220        va_list ap;
    1221         guint16 chan, nummissed, reason;
     1221        guint16 nummissed, reason;
    12221222        aim_userinfo_t *userinfo;
    12231223
    12241224        va_start(ap, fr);
    1225         chan = (guint16)va_arg(ap, unsigned int);
     1225        va_arg(ap, unsigned int); /* chan */
    12261226        userinfo = va_arg(ap, aim_userinfo_t *);
    12271227        nummissed = (guint16)va_arg(ap, unsigned int);
     
    13351335
    13361336static int gaim_parse_motd(aim_session_t *sess, aim_frame_t *fr, ...) {
    1337         char *msg;
    13381337        guint16 id;
    13391338        va_list ap;
     
    13411340        va_start(ap, fr);
    13421341        id  = (guint16)va_arg(ap, unsigned int);
    1343         msg = va_arg(ap, char *);
     1342        va_arg(ap, char *); /* msg */
    13441343        va_end(ap);
    13451344
     
    13611360        switch(type) {
    13621361                case 0x0002: {
    1363                         guint8 maxrooms;
    1364                         struct aim_chat_exchangeinfo *exchanges;
    1365                         int exchangecount; // i;
    1366 
    1367                         maxrooms = (guint8)va_arg(ap, unsigned int);
    1368                         exchangecount = va_arg(ap, int);
    1369                         exchanges = va_arg(ap, struct aim_chat_exchangeinfo *);
     1362                        va_arg(ap, unsigned int); /* maxrooms */
     1363                        va_arg(ap, int); /* exchangecount */
     1364                        va_arg(ap, struct aim_chat_exchangeinfo *); /* exchanges */
    13701365                        va_end(ap);
    13711366
     
    13801375                        break;
    13811376                case 0x0008: {
    1382                         char *fqcn, *name, *ck;
    1383                         guint16 instance, flags, maxmsglen, maxoccupancy, unknown, exchange;
    1384                         guint8 createperms;
    1385                         guint32 createtime;
    1386 
    1387                         fqcn = va_arg(ap, char *);
     1377                        char *ck;
     1378                        guint16 instance, exchange;
     1379
     1380                        va_arg(ap, char *); /* fqcn */
    13881381                        instance = (guint16)va_arg(ap, unsigned int);
    13891382                        exchange = (guint16)va_arg(ap, unsigned int);
    1390                         flags = (guint16)va_arg(ap, unsigned int);
    1391                         createtime = va_arg(ap, guint32);
    1392                         maxmsglen = (guint16)va_arg(ap, unsigned int);
    1393                         maxoccupancy = (guint16)va_arg(ap, unsigned int);
    1394                         createperms = (guint8)va_arg(ap, int);
    1395                         unknown = (guint16)va_arg(ap, unsigned int);
    1396                         name = va_arg(ap, char *);
     1383                        va_arg(ap, unsigned int); /* flags */
     1384                        va_arg(ap, guint32); /* createtime */
     1385                        va_arg(ap, unsigned int); /* maxmsglen */
     1386                        va_arg(ap, unsigned int); /* maxoccupancy */
     1387                        va_arg(ap, int); /* createperms */
     1388                        va_arg(ap, unsigned int); /* unknown */
     1389                        va_arg(ap, char *); /* name */
    13971390                        ck = va_arg(ap, char *);
    13981391                        va_end(ap);
     
    14561449static int gaim_chat_info_update(aim_session_t *sess, aim_frame_t *fr, ...) {
    14571450        va_list ap;
    1458         aim_userinfo_t *userinfo;
    1459         struct aim_chat_roominfo *roominfo;
    1460         char *roomname;
    1461         int usercount;
    1462         char *roomdesc;
    1463         guint16 unknown_c9, unknown_d2, unknown_d5, maxmsglen, maxvisiblemsglen;
    1464         guint32 creationtime;
     1451        guint16 maxmsglen, maxvisiblemsglen;
    14651452        struct im_connection *ic = sess->aux_data;
    14661453        struct chat_connection *ccon = find_oscar_chat_by_conn(ic, fr->conn);
    14671454
    14681455        va_start(ap, fr);
    1469         roominfo = va_arg(ap, struct aim_chat_roominfo *);
    1470         roomname = va_arg(ap, char *);
    1471         usercount= va_arg(ap, int);
    1472         userinfo = va_arg(ap, aim_userinfo_t *);
    1473         roomdesc = va_arg(ap, char *);
    1474         unknown_c9 = (guint16)va_arg(ap, int);
    1475         creationtime = (guint32)va_arg(ap, unsigned long);
     1456        va_arg(ap, struct aim_chat_roominfo *); /* roominfo */
     1457        va_arg(ap, char *); /* roomname */
     1458        va_arg(ap, int); /* usercount */
     1459        va_arg(ap, aim_userinfo_t *); /* userinfo */
     1460        va_arg(ap, char *); /* roomdesc */
     1461        va_arg(ap, int); /* unknown_c9 */
     1462        va_arg(ap, unsigned long); /* creationtime */
    14761463        maxmsglen = (guint16)va_arg(ap, int);
    1477         unknown_d2 = (guint16)va_arg(ap, int);
    1478         unknown_d5 = (guint16)va_arg(ap, int);
     1464        va_arg(ap, int); /* unknown_d2 */
     1465        va_arg(ap, int); /* unknown_d5 */
    14791466        maxvisiblemsglen = (guint16)va_arg(ap, int);
    14801467        va_end(ap);
     
    15171504#endif
    15181505        va_list ap;
    1519         guint16 code, rateclass;
    1520         guint32 windowsize, clear, alert, limit, disconnect, currentavg, maxavg;
     1506        guint16 code;
     1507        guint32 windowsize, clear, currentavg;
    15211508
    15221509        va_start(ap, fr);
    15231510        code = (guint16)va_arg(ap, unsigned int);
    1524         rateclass= (guint16)va_arg(ap, unsigned int);
     1511        va_arg(ap, unsigned int); /* rateclass */
    15251512        windowsize = (guint32)va_arg(ap, unsigned long);
    15261513        clear = (guint32)va_arg(ap, unsigned long);
    1527         alert = (guint32)va_arg(ap, unsigned long);
    1528         limit = (guint32)va_arg(ap, unsigned long);
    1529         disconnect = (guint32)va_arg(ap, unsigned long);
     1514        va_arg(ap, unsigned long); /* alert */
     1515        va_arg(ap, unsigned long); /* limit */
     1516        va_arg(ap, unsigned long); /* disconnect */
    15301517        currentavg = (guint32)va_arg(ap, unsigned long);
    1531         maxavg = (guint32)va_arg(ap, unsigned long);
     1518        va_arg(ap, unsigned long); /* maxavg */
    15321519        va_end(ap);
    15331520
     
    24172404        struct im_connection * ic = sess->aux_data;
    24182405        va_list ap;
    2419         guint16 type1, type2;
     2406        guint16 type2;
    24202407        char * sn;
    24212408
    24222409        va_start(ap, fr);
    2423         type1 = va_arg(ap, int);
     2410        va_arg(ap, int); /* type1 */
    24242411        sn = va_arg(ap, char*);
    24252412        type2 = va_arg(ap, int);
     
    25412528
    25422529        if((cur = aim_getconn_type(od->sess, AIM_CONN_TYPE_CHATNAV))) {
    2543                 int st;
    2544                
    2545                 st = aim_chatnav_createroom(od->sess, cur, room, exchange_number);
     2530                aim_chatnav_createroom(od->sess, cur, room, exchange_number);
    25462531               
    25472532                return ret;
     
    25702555        static int chat_id = 0;
    25712556        char * chatname, *s;
    2572         struct groupchat *c;
    25732557       
    25742558        chatname = g_strdup_printf("%s%s%d", isdigit(*ic->acc->user) ? "icq" : "",
     
    25792563                        *s = '0';
    25802564       
    2581         c = imcb_chat_new(ic, chatname);
    25822565        ret = oscar_chat_join_internal(ic, chatname, NULL, NULL, 4);
    25832566        aim_chat_invite(od->sess, od->conn, who, "", 4, chatname, 0x0);
     
    25852568        g_free(chatname);
    25862569       
    2587         return NULL;
     2570        return ret;
    25882571}
    25892572
  • protocols/oscar/rxqueue.c

    rdf98ee8 rb041b52  
    388388         */
    389389        if (aimbs_get8(&flaphdr) != 0x2a) {
    390                 guint8 start;
    391 
    392390                aim_bstream_rewind(&flaphdr);
    393                 start = aimbs_get8(&flaphdr);
     391                aimbs_get8(&flaphdr);
    394392                imcb_error(sess->aux_data, "FLAP framing disrupted");
    395393                aim_conn_close(conn);
  • protocols/oscar/service.c

    rdf98ee8 rb041b52  
    563563        groupcount = aimbs_get16(bs);
    564564        for (i = 0; i < groupcount; i++) {
    565                 guint16 group;
    566 
    567                 group = aimbs_get16(bs);
     565                aimbs_get16(bs);
    568566
    569567                imcb_error(sess->aux_data, "bifurcated migration unsupported");
     
    701699static int hostversions(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
    702700{
    703         int vercount;
    704701        guint8 *versions;
    705702
    706703        /* This is frivolous. (Thank you SmarterChild.) */
    707         vercount = aim_bstream_empty(bs)/4;
     704        aim_bstream_empty(bs); /* == vercount * 4 */
    708705        versions = aimbs_getraw(bs, aim_bstream_empty(bs));
    709706        g_free(versions);
     
    731728        aim_tlvlist_t *tl = NULL;
    732729        guint32 data;
    733         int tlvlen;
    734730        struct im_connection *ic = sess ? sess->aux_data : NULL;
    735731
     
    739735                data |= AIM_ICQ_STATE_WEBAWARE;
    740736
    741         tlvlen = aim_addtlvtochain32(&tl, 0x0006, data);
     737        aim_addtlvtochain32(&tl, 0x0006, data); /* tlvlen */
    742738
    743739        if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10 + 8)))
  • protocols/yahoo/libyahoo2.c

    rdf98ee8 rb041b52  
    18091809        struct yahoo_input_data *yid = had->yid;
    18101810        struct yahoo_data *yd = yid->yd;
    1811         struct http_request *req;
    18121811        char *login, *passwd, *chal;
    18131812        char *url;
     
    18231822                               (int) time(NULL), login, passwd, chal);
    18241823       
    1825         req = http_dorequest_url(url, yahoo_https_auth_token_finish, had);
     1824        http_dorequest_url(url, yahoo_https_auth_token_finish, had);
    18261825       
    18271826        g_free(url);
     
    18701869static void yahoo_https_auth_init(struct yahoo_https_auth_data *had)
    18711870{
    1872         struct http_request *req;
    18731871        char *url;
    18741872       
     
    18761874                              (int) time(NULL), had->token);
    18771875       
    1878         req = http_dorequest_url(url, yahoo_https_auth_finish, had);
     1876        http_dorequest_url(url, yahoo_https_auth_finish, had);
    18791877       
    18801878        g_free(url);
     
    19901988{
    19911989        struct yahoo_data *yd = yid->yd;
    1992         char *login_id;
    1993         char *handle;
    19941990        char *url = NULL;
    19951991        int login_status = -1;
     
    20001996                struct yahoo_pair *pair = l->data;
    20011997                if (pair->key == 0)
    2002                         login_id = pair->value;
     1998                        ; /* login_id */
    20031999                else if (pair->key == 1)
    2004                         handle = pair->value;
     2000                        ; /* handle */
    20052001                else if (pair->key == 20)
    20062002                        url = pair->value;
     
    20892085        char *msg = NULL;
    20902086        char *name = NULL;
    2091         long tm = 0L;
    20922087        int state = YAHOO_STATUS_AVAILABLE;
    2093         int online = 0;
    20942088        int away = 0;
    20952089        int idle = 0;
     
    21112105                        state = strtol(pair->value, NULL, 10);
    21122106                else if (pair->key == 15)
    2113                         tm = strtol(pair->value, NULL, 10);
     2107                        ; /* tm */
    21142108                else if (pair->key == 13)
    2115                         online = strtol(pair->value, NULL, 10);
     2109                        ; /* online */
    21162110                else if (pair->key == 47)
    21172111                        away = strtol(pair->value, NULL, 10);
     
    21402134        char *where = NULL;
    21412135        int status = 0;
    2142         char *me = NULL;
    21432136
    21442137        struct yahoo_buddy *bud = NULL;
     
    21482141                struct yahoo_pair *pair = l->data;
    21492142                if (pair->key == 1)
    2150                         me = pair->value;
     2143                        ; /* Me... don't care */
    21512144                if (pair->key == 7)
    21522145                        who = pair->value;
     
    22042197        char *who = NULL;
    22052198        char *where = NULL;
    2206         int unk_66 = 0;
    2207         char *me = NULL;
    22082199        struct yahoo_buddy *bud;
    22092200
     
    22142205                struct yahoo_pair *pair = l->data;
    22152206                if (pair->key == 1)
    2216                         me = pair->value;
     2207                        ; /* Me... don't care */
    22172208                else if (pair->key == 7)
    22182209                        who = pair->value;
     
    22202211                        where = pair->value;
    22212212                else if (pair->key == 66)
    2222                         unk_66 = strtol(pair->value, NULL, 10);
     2213                        ; /* unk_66 */
    22232214                else
    22242215                        DEBUG_MSG(("unknown key: %d = %s", pair->key,
     
    22562247        struct yahoo_packet *pkt)
    22572248{
    2258         char *who = NULL;
    2259         int status = 0;
    2260         char *me = NULL;
    2261         int un_ignore = 0;
    2262 
    22632249        YList *l;
    22642250        for (l = pkt->hash; l; l = l->next) {
    22652251                struct yahoo_pair *pair = l->data;
    22662252                if (pair->key == 0)
    2267                         who = pair->value;
     2253                        ; /* who */
    22682254                if (pair->key == 1)
    2269                         me = pair->value;
     2255                        ; /* Me... don't care */
    22702256                if (pair->key == 13)    /* 1 == ignore, 2 == unignore */
    2271                         un_ignore = strtol(pair->value, NULL, 10);
     2257                        ;
    22722258                if (pair->key == 66)
    2273                         status = strtol(pair->value, NULL, 10);
     2259                        ; /* status */
    22742260        }
    22752261
     
    22932279        char *me = NULL;
    22942280        char *room = NULL;
    2295         char *voice_room = NULL;
    22962281
    22972282        YList *l;
     
    23032288                        me = pair->value;
    23042289                if (pair->key == 13)
    2305                         voice_room = pair->value;
     2290                        ; /* voice room */
    23062291                if (pair->key == 57)
    23072292                        room = pair->value;
     
    24382423        struct yahoo_packet *pkt)
    24392424{
    2440         char *me = NULL;
    24412425        char *key = NULL;
    24422426        char *who = NULL;
     
    24472431                struct yahoo_pair *pair = l->data;
    24482432                if (pair->key == 5)
    2449                         me = pair->value;
     2433                        ; /* me */
    24502434                if (pair->key == 61)
    24512435                        key = pair->value;
     
    33693353        struct yahoo_webcam *wcm = y->wcm;
    33703354        struct yahoo_input_data *yid;
    3371         struct yahoo_server_settings *yss;
    33723355
    33733356        if (!wcm || !wcm->server || !wcm->key)
     
    33813364        yid->wcm = y->wcm;
    33823365        y->wcm = NULL;
    3383 
    3384         yss = y->yd->server_settings;
    33853366
    33863367        yid->wcd = y_new0(struct yahoo_webcam_data, 1);
     
    49754956        YList *l;
    49764957        struct send_file_data *sfd;
    4977         char *who = NULL;
    4978         char *filename = NULL;
    49794958        char *id = NULL;
    49804959        char *token = NULL;
     
    49844963                switch (pair->key) {
    49854964                case 4:
    4986                         who = pair->value;
     4965                        /* who */
    49874966                        break;
    49884967                case 5:
     
    49984977                        break;
    49994978                case 27:
    5000                         filename = pair->value;
     4979                        /* filename */
    50014980                        break;
    50024981                }
     
    50235002{
    50245003        YList *l;
    5025         char *who = NULL;
    5026         char *filename = NULL;
    50275004        char *id = NULL;
    50285005        char *token = NULL;
     
    50365013                case 1:
    50375014                case 4:
    5038                         who = pair->value;
     5015                        /* who */
    50395016                        break;
    50405017                case 5:
     
    50535030                        break;
    50545031                case 27:
    5055                         filename = pair->value;
     5032                        /* filename */
    50565033                        break;
    50575034                }
Note: See TracChangeset for help on using the changeset viewer.