From c5a52cdb6e1ee6dd3bf562b74fbadc999600f314 Mon Sep 17 00:00:00 2001 From: wangyu Date: Mon, 4 Jun 2018 02:01:57 -0700 Subject: [PATCH] fix warnings --- common.cpp | 8 ++++---- lib/{fec.c => fec.cpp} | 6 +++--- lib/{rs.c => rs.cpp} | 0 makefile | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) rename lib/{fec.c => fec.cpp} (99%) rename lib/{rs.c => rs.cpp} (100%) diff --git a/common.cpp b/common.cpp index a5709c7..deabdcf 100644 --- a/common.cpp +++ b/common.cpp @@ -318,9 +318,9 @@ void setnonblocking(int sock) { Generic checksum calculation function */ unsigned short csum(const unsigned short *ptr,int nbytes) { - register long sum; + long sum; unsigned short oddbyte; - register short answer; + short answer; sum=0; while(nbytes>1) { @@ -343,9 +343,9 @@ unsigned short csum(const unsigned short *ptr,int nbytes) { unsigned short tcp_csum(const pseudo_header & ph,const unsigned short *ptr,int nbytes) {//works both for big and little endian - register long sum; + long sum; unsigned short oddbyte; - register short answer; + short answer; sum=0; unsigned short * tmp= (unsigned short *)&ph; diff --git a/lib/fec.c b/lib/fec.cpp similarity index 99% rename from lib/fec.c rename to lib/fec.cpp index a392901..f8e1f25 100644 --- a/lib/fec.c +++ b/lib/fec.cpp @@ -195,7 +195,7 @@ static gf gf_mul_table[GF_SIZE + 1][GF_SIZE + 1]; #define gf_mul(x,y) gf_mul_table[x][y] -#define USE_GF_MULC register gf * __gf_mulc_ +#define USE_GF_MULC gf * __gf_mulc_ #define GF_MULC0(c) __gf_mulc_ = gf_mul_table[c] #define GF_ADDMULC(dst, x) dst ^= __gf_mulc_[x] @@ -220,7 +220,7 @@ gf_mul(x,y) } #define init_mul_table() -#define USE_GF_MULC register gf * __gf_mulc_ +#define USE_GF_MULC gf * __gf_mulc_ #define GF_MULC0(c) __gf_mulc_ = &gf_exp[ gf_log[c] ] #define GF_ADDMULC(dst, x) { if (x) dst ^= __gf_mulc_[ gf_log[x] ] ; } #endif @@ -341,7 +341,7 @@ static void addmul1(gf *dst1, gf *src1, gf c, int sz) { USE_GF_MULC ; - register gf *dst = dst1, *src = src1 ; + gf *dst = dst1, *src = src1 ; gf *lim = &dst[sz - UNROLL + 1] ; GF_MULC0(c) ; diff --git a/lib/rs.c b/lib/rs.cpp similarity index 100% rename from lib/rs.c rename to lib/rs.cpp diff --git a/makefile b/makefile index b1522be..d623b89 100755 --- a/makefile +++ b/makefile @@ -8,7 +8,7 @@ cc_arm= /toolchains/arm-2014.05/bin/arm-none-linux-gnueabi-g++ #cc_bcm2708=/home/wangyu/raspberry/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++ FLAGS= -std=c++11 -Wall -Wextra -Wno-unused-variable -Wno-unused-parameter -Wno-missing-field-initializers -SOURCES=main.cpp log.cpp common.cpp lib/fec.c lib/rs.c packet.cpp delay_manager.cpp fd_manager.cpp connection.cpp fec_manager.cpp misc.cpp tunnel_client.cpp tunnel_server.cpp my_ev.cpp -isystem libev +SOURCES=main.cpp log.cpp common.cpp lib/fec.cpp lib/rs.cpp packet.cpp delay_manager.cpp fd_manager.cpp connection.cpp fec_manager.cpp misc.cpp tunnel_client.cpp tunnel_server.cpp my_ev.cpp -isystem libev NAME=speederv2 TARGETS=amd64 arm mips24kc_be x86 mips24kc_le