Changeset 18817


Ignore:
Timestamp:
03/23/12 16:02:07 (14 months ago)
Author:
BrainSlayer
Message:

fix some warnings

Location:
src/router/pppd.new/pppd
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • src/router/pppd.new/pppd/Makefile.linux

    r18816 r18817  
    9595endif 
    9696 
    97 CFLAGS+= $(COMPILE_FLAGS) $(INCLUDE_DIRS) '-DDESTDIR="@DESTDIR@"' 
     97CFLAGS+= -ffunction-sections -fdata-sections -Wl,--gc-sections -Wall $(COMPILE_FLAGS) $(INCLUDE_DIRS) '-DDESTDIR="@DESTDIR@"' 
    9898 
    9999 
  • src/router/pppd.new/pppd/plugins/pptp/Makefile

    r17906 r18817  
    1313 
    1414PLUGIN=pptp 
    15 COPTS = -O2 
    16 CFLAGS=-I. -I../../../ $(COPTS) -fPIC -DRC_LOG_FACILITY=LOG_DAEMON -DNEED_PRINTF 
     15CFLAGS=-Wall -ffunction-sections -fdata-sections -Wl,--gc-sections -I. -I../../../ $(COPTS) -fPIC -DRC_LOG_FACILITY=LOG_DAEMON -DNEED_PRINTF 
    1716 
    1817 
  • src/router/pppd.new/pppd/plugins/radius/Makefile.linux

    r17901 r18817  
    1414PLUGIN=radius.so radattr.so radrealms.so 
    1515#COPTS = -O2 
    16 CFLAGS=-I. -I../.. -I../../../include $(COPTS) -fPIC -DRC_LOG_FACILITY=LOG_DAEMON  
     16CFLAGS=-Wall -ffunction-sections -fdata-sections -Wl,--gc-sections  -I. -I../.. -I../../../include $(COPTS) -fPIC -DRC_LOG_FACILITY=LOG_DAEMON  
    1717 
    1818 
  • src/router/pppd.new/pppd/plugins/radius/avpair.c

    r6803 r18817  
    7777                                vp->lvalue = len; 
    7878                        } else { 
    79                         strncpy (vp->strvalue, (char *) pval, AUTH_STRING_LEN); 
     79                        strncpy ((char*)vp->strvalue, (char *) pval, AUTH_STRING_LEN); 
    8080                        vp->lvalue = strlen((char *) pval); 
    8181                        } 
     
    197197                                x_len--, x_ptr++) 
    198198                        { 
    199                                 sprintf (hex, "%2.2X", *x_ptr); 
    200                                 strcat (buffer, hex); 
     199                                sprintf ((char*)hex, "%2.2X", *x_ptr); 
     200                                strcat (buffer, (char*)hex); 
    201201                        } 
    202202                        warn("rc_avpair_gen: received unknown attribute %d of length %d: 0x%s", 
     
    598598 
    599599                            case PW_TYPE_STRING: 
    600                                 strcpy (pair->strvalue, valstr); 
     600                                strcpy ((char*)pair->strvalue, valstr); 
    601601                                pair->lvalue = strlen(valstr); 
    602602                                break; 
     
    722722                        else 
    723723                        { 
    724                                 strncat(value, ptr, 1); 
     724                                strncat(value, (char*)ptr, 1); 
    725725                                lv--; 
    726726                                if (lv < 0) break; 
     
    738738                else 
    739739                { 
    740                         sprintf (buffer, "%ld", pair->lvalue); 
     740                        sprintf (buffer, "%d", pair->lvalue); 
    741741                        strncpy(value, buffer, (size_t) lv); 
    742742                } 
  • src/router/pppd.new/pppd/plugins/radius/radius.c

    r12192 r18817  
    634634            switch (vp->attribute) { 
    635635            case PW_MS_CHAP2_SUCCESS: 
    636                 if ((vp->lvalue != 43) || strncmp(vp->strvalue + 1, "S=", 2)) { 
     636                if ((vp->lvalue != 43) || strncmp((char*)vp->strvalue + 1, "S=", 2)) { 
    637637                    slprintf(msg,BUF_LEN,"RADIUS: bad MS-CHAP2-Success packet"); 
    638638                    return -1; 
    639639                } 
    640640                if (message != NULL) 
    641                     strlcpy(message, vp->strvalue + 1, message_space); 
     641                    strlcpy(message, (char*)vp->strvalue + 1, message_space); 
    642642                ms_chap2_success = 1; 
    643643                break; 
  • src/router/pppd.new/pppd/plugins/radius/sendserver.c

    r6803 r18817  
    105105 
    106106                    secretlen = strlen (secret); 
    107                     vector = (char *)auth->vector; 
     107                    vector = (unsigned char *)auth->vector; 
    108108                    for(i = 0; i < padded_length; i += AUTH_VECTOR_LEN) { 
    109109                        /* Calculate the MD5 digest*/ 
     
    201201        UINT4           auth_ipaddr; 
    202202        char           *server_name;    /* Name of server to query */ 
    203         int             salen; 
     203        unsigned int             salen; 
    204204        int             result; 
    205205        int             total_length; 
    206         int             length; 
     206        unsigned int             length; 
    207207        int             retry_max; 
    208208        int             secretlen; 
     
    273273                secretlen = strlen (secret); 
    274274                memcpy ((char *) auth + total_length, secret, secretlen); 
    275                 rc_md5_calc (vector, (char *) auth, total_length + secretlen); 
     275                rc_md5_calc (vector, (unsigned char *) auth, total_length + secretlen); 
    276276                memcpy ((char *) auth->vector, (char *) vector, AUTH_VECTOR_LEN); 
    277277        } 
     
    363363                if ((vp = rc_avpair_get(vp, PW_REPLY_MESSAGE))) 
    364364                { 
    365                         strcat(msg, vp->strvalue); 
     365                        strcat(msg, (char*)vp->strvalue); 
    366366                        strcat(msg, "\n"); 
    367367                        vp = vp->next; 
     
    429429        memcpy ((char *) auth->vector, (char *) vector, AUTH_VECTOR_LEN); 
    430430        memcpy ((char *) auth + totallen, secret, secretlen); 
    431         rc_md5_calc (calc_digest, (char *) auth, totallen + secretlen); 
     431        rc_md5_calc (calc_digest, (unsigned char *) auth, totallen + secretlen); 
    432432 
    433433#ifdef DIGEST_DEBUG 
  • src/router/pppd.new/pppd/plugins/rp-pppoe/Makefile.linux

    r17756 r18817  
    2626 
    2727#COPTS=-O2 -g 
    28 CFLAGS=$(COPTS) -I../../../include/linux  
     28CFLAGS= -Wall -ffunction-sections -fdata-sections -Wl,--gc-sections $(COPTS) -I../../../include/linux  
    2929#CFLAGS=$(COPTS) -I$(LINUXDIR)/include/linux 
    3030 
  • src/router/pppd.new/pppd/pppd.h

    r16201 r18817  
    525525 
    526526#ifndef NEED_PRINTF 
    527 #define option_error(fmt,args...) { } 
    528  
    529  
    530 #define notice(fmt,...) { } 
    531 #define info(fmt,...) { } 
    532 #define dbglog(fmt,...) { } 
    533 #define warn(fmt,...) { } 
     527#define option_error(fmt,args...) do { } while(0) 
     528 
     529 
     530#define notice(fmt,...)do { } while(0) 
     531#define info(fmt,...) do { } while(0) 
     532#define dbglog(fmt,...) do { } while(0) 
     533#define warn(fmt,...) do { } while(0) 
    534534#define error(fmt,...) { ++error_count; } 
    535535#define fatal(fmt,...) { die(1); } 
Note: See TracChangeset for help on using the changeset viewer.