Changeset 847 for branches


Ignore:
Timestamp:
04/30/10 01:51:48 (22 months ago)
Author:
wd
Message:

Fix incorrect usage of va_* macros (at least on x64 linux)
(patch courtesy of elly@…)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ithildin-1.1/modules/ircd/send.c

    r833 r847  
    225225    va_list vl; 
    226226 
    227     va_start(vl, msg); 
    228227 
    229228    /* walk our server list */ 
     
    234233 
    235234        if (conn->proto->tmpmsg == NULL) 
     235        { 
     236            va_start(vl, msg); 
    236237            sm = conn->proto->output(&ps, cmd, to, msg, vl); 
     238            va_end(vl); 
     239        } 
    237240        if (CACHE_MSG(conn->proto)) { 
    238241            conn->proto->tmpmsg = create_sendq_block(sm->msg, sm->len); 
     
    243246 
    244247    CLEAR_SEND_TEMPS(); 
    245     va_end(vl); 
    246248} 
    247249 
     
    255257    va_list vl; 
    256258 
    257     va_start(vl, msg); 
    258  
    259259    /* walk our server list */ 
    260260    ones = srv_uplink(one); 
     
    266266 
    267267        if (conn->proto->tmpmsg == NULL) 
     268        { 
     269            va_start(vl, msg); 
    268270            sm = conn->proto->output(&ps, cmd, to, msg, vl); 
     271            va_end(vl); 
     272        } 
    269273        if (CACHE_MSG(conn->proto)) { 
    270274            conn->proto->tmpmsg = create_sendq_block(sm->msg, sm->len); 
     
    275279 
    276280    CLEAR_SEND_TEMPS(); 
    277     va_end(vl); 
    278 } 
     281} 
     282 
    279283/* sends a message to everyone in a channel (including sender) */ 
    280284void sendto_channel(channel_t *chan, client_t *cli, server_t *srv, char *cmd, 
     
    285289    connection_t *conn; 
    286290    va_list vl; 
    287     va_start(vl, msg); 
    288291         
    289292    /* walk the channel list, for remote users, only pass the message to their 
     
    298301 
    299302        if (conn->proto->tmpmsg == NULL) 
     303        { 
     304            va_start(vl, msg); 
    300305            sm = conn->proto->output(&ps, cmd, chan->name, msg, vl); 
     306            va_end(vl); 
     307        } 
    301308        if (CACHE_MSG(conn->proto)) { 
    302309            conn->proto->tmpmsg = create_sendq_block(sm->msg, sm->len); 
     
    307314 
    308315    CLEAR_SEND_TEMPS(); 
    309     va_end(vl); 
    310316} 
    311317         
     
    319325    connection_t *conn; 
    320326    va_list vl; 
    321     va_start(vl, msg); 
    322327         
    323328    /* walk the channel list, only send to our own clients. */ 
     
    331336 
    332337        if (conn->proto->tmpmsg == NULL) 
     338        { 
     339            va_start(vl, msg); 
    333340            sm = conn->proto->output(&ps, cmd, chan->name, msg, vl); 
     341            va_end(vl); 
     342        } 
    334343        if (CACHE_MSG(conn->proto)) { 
    335344            conn->proto->tmpmsg = create_sendq_block(sm->msg, sm->len); 
     
    340349 
    341350    CLEAR_SEND_TEMPS(); 
    342     va_end(vl); 
    343351} 
    344352 
     
    352360    connection_t *conn; 
    353361    va_list vl; 
    354     va_start(vl, msg); 
    355362         
    356363    /* walk the channel list, only send to our own clients. */ 
     
    368375 
    369376        if (conn->proto->tmpmsg == NULL) 
     377        { 
     378            va_start(vl, msg); 
    370379            sm = conn->proto->output(&ps, cmd, chan->name, msg, vl); 
     380            va_end(vl); 
     381        } 
    371382        if (CACHE_MSG(conn->proto)) { 
    372383            conn->proto->tmpmsg = create_sendq_block(sm->msg, sm->len); 
     
    377388 
    378389    CLEAR_SEND_TEMPS(); 
    379     va_end(vl); 
    380390} 
    381391 
     
    388398    connection_t *conn, *onec; 
    389399    va_list vl; 
    390     va_start(vl, msg); 
    391400         
    392401    /* just like above, but skip 'one'.  ideally, when I can pass varargs with 
     
    404413 
    405414        if (conn->proto->tmpmsg == NULL) 
     415        { 
     416            va_start(vl, msg); 
    406417            sm = conn->proto->output(&ps, cmd, chan->name, msg, vl); 
     418            va_end(vl); 
     419        } 
    407420        if (CACHE_MSG(conn->proto)) { 
    408421            conn->proto->tmpmsg = create_sendq_block(sm->msg, sm->len); 
     
    413426 
    414427    CLEAR_SEND_TEMPS(); 
    415     va_end(vl); 
    416428} 
    417429 
     
    428440    char pname[512]; /* prefixed name. */ 
    429441    va_list vl; 
    430     va_start(vl, msg); 
    431442         
    432443    sprintf(pname, "%s%s", prefixes, chan->name); 
     
    453464 
    454465        if (conn->proto->tmpmsg == NULL) 
     466        { 
     467            va_start(vl, msg); 
    455468            sm = conn->proto->output(&ps, cmd, pname, msg, vl); 
     469            va_end(vl); 
     470        } 
    456471        if (CACHE_MSG(conn->proto)) { 
    457472            conn->proto->tmpmsg = create_sendq_block(sm->msg, sm->len); 
     
    462477 
    463478    CLEAR_SEND_TEMPS(); 
    464     va_end(vl); 
    465479} 
    466480 
     
    480494    connection_t *conn; 
    481495    va_list vl; 
    482     va_start(vl, msg); 
    483496         
    484497    /* for each channel the user is in, walk the list and do sends.  it would 
     
    506519                ircd.sends[conn->sock->fd] = 1; 
    507520                if (conn->proto->tmpmsg == NULL) 
     521                { 
     522                    va_start(vl, msg); 
    508523                    sm = conn->proto->output(&ps, cmd, NULL, msg, vl); 
     524                    va_end(vl); 
     525                } 
    509526                if (CACHE_MSG(conn->proto)) { 
    510527                    conn->proto->tmpmsg = create_sendq_block(sm->msg, sm->len); 
     
    517534 
    518535    CLEAR_SEND_TEMPS(); 
    519     va_end(vl); 
    520536} 
    521537 
     
    538554    } 
    539555 
    540     va_start(vl, msg); 
    541  
    542556    /* walk the list of clients for the network, do matches as necessary.  a 
    543557     * lot of matches for non-local clients are luckily pre-empted if we're 
     
    560574 
    561575        if (conn->proto->tmpmsg == NULL) 
     576        { 
     577            va_start(vl, msg); 
    562578            sm = conn->proto->output(&ps, cmd, mask, msg, vl); 
     579            va_end(vl); 
     580        } 
    563581        if (CACHE_MSG(conn->proto)) { 
    564582            conn->proto->tmpmsg = create_sendq_block(sm->msg, sm->len); 
     
    569587 
    570588    CLEAR_SEND_TEMPS(); 
    571     va_end(vl); 
    572589} 
    573590 
     
    578595    struct chanlink *cp; 
    579596    va_list vl; 
    580     va_start(vl, msg); 
    581597         
    582598    /* just walk the list.  we shouldn't have any remote users if this is being 
     
    588604            continue; 
    589605 
     606        va_start(vl, msg); 
    590607        sendto_common(cp->cli->conn, cli, srv, cmd, 
    591608                (target ? cp->cli->nick : NULL), msg, vl); 
     609        va_end(vl); 
    592610    } 
    593611 
    594612    /* we don't touch the temp stuff here. */ 
    595     va_end(vl); 
    596613} 
    597614/***************************************************************************** 
Note: See TracChangeset for help on using the changeset viewer.