浏览代码

fix warnings

wangyu 7 年之前
父节点
当前提交
c5a52cdb6e
共有 4 个文件被更改,包括 8 次插入8 次删除
  1. 4 4
      common.cpp
  2. 3 3
      lib/fec.cpp
  3. 0 0
      lib/rs.cpp
  4. 1 1
      makefile

+ 4 - 4
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;

+ 3 - 3
lib/fec.c → 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) ;

+ 0 - 0
lib/rs.c → lib/rs.cpp


+ 1 - 1
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