Преглед на файлове

去掉函数调用换行时末尾多余的"\"符号

niujiuru преди 2 месеца
родител
ревизия
feb8346152
променени са 9 файла, в които са добавени 19 реда и са изтрити 20 реда
  1. 4 4
      air530z/air530z.c
  2. 2 2
      air720u/air720u.c
  3. 1 1
      dh_takephoto/takephoto.c
  4. 2 2
      ec200u/ec200u.c
  5. 1 1
      hk_takephoto/takephoto.c
  6. 4 4
      swapi/subjects/serial/serial.c
  7. 1 1
      swapi/subjects/serial/serial.h
  8. 1 2
      swapi/swthrdpool.c
  9. 3 3
      ymodem/ymodem.c

+ 4 - 4
air530z/air530z.c

@@ -115,8 +115,8 @@ static int comio_data_recv_proc(unsigned long wParam/*传递打开的串口句
       sw_rwlock_unlock(pComIO->out_rwlock);
 
       // 3-打印定位结果
-      sw_log_trace("[%s] 已定位: lat=%.6f, lon=%.6f, HDOP=%.1f, Sats=%d/%d, DeltaMeters=%.1fm, IsWeakPos=%d", MODULE_NAME, \
-                   out_lat, out_lon, pComIO->info.HDOP, \
+      sw_log_trace("[%s] 已定位: lat=%.6f, lon=%.6f, HDOP=%.1f, Sats=%d/%d, DeltaMeters=%.1fm, IsWeakPos=%d", MODULE_NAME,
+                   out_lat, out_lon, pComIO->info.HDOP,
                    pComIO->info.satinfo.inuse, pComIO->info.satinfo.inview, dist, bWeakPos);
     }
 
@@ -150,11 +150,11 @@ int Air530Z_ComInit()
   const char *serialName = "/dev/ttymxc6"; int baudrate = 9600;
 #endif
   const char *parityCheck = "none"; // 无校检
-  s_myCom.h = serial_open(serialName, baudrate, parityCheck, \
+  s_myCom.h = serial_open(serialName, baudrate, parityCheck,
                           comio_data_recv_proc, comio_data_recv_proc, NULL);
   if(!s_myCom.h)
   {
-    sw_log_error("[%s] failed to open the \"%s:%d(%s parity)\" device!!", \
+    sw_log_error("[%s] failed to open the \"%s:%d(%s parity)\" device!!",
                  MODULE_NAME, serialName, baudrate, parityCheck);
     Air530Z_ComExit(); return -2;
   }

+ 2 - 2
air720u/air720u.c

@@ -167,11 +167,11 @@ int Air720U_ComInit()
 
   const char *serialName = "/dev/ttyUSB0"; int baudrate = 115200;
   const char *parityCheck = "none"; // 无校检
-  s_myCom.h = serial_open(serialName, baudrate, parityCheck, \
+  s_myCom.h = serial_open(serialName, baudrate, parityCheck,
                           comio_data_recv_proc, comio_data_recv_proc, NULL);
   if(!s_myCom.h)
   {
-    sw_log_error("[%s] failed to open the \"%s:%d(%s parity)\" device!!", \
+    sw_log_error("[%s] failed to open the \"%s:%d(%s parity)\" device!!",
                  MODULE_NAME, serialName, baudrate, parityCheck);
     Air720U_ComExit(); return -1;
   }

+ 1 - 1
dh_takephoto/takephoto.c

@@ -39,7 +39,7 @@ typedef struct
 static const char * const huaray_manu_aliases[] = { "Machine Vision", NULL };
 static bool is_huaray_manu_alias(const char *name)
 {
-  for(int i = 0; i < huaray_manu_aliases[i] != NULL; i++)
+  for(int i = 0; huaray_manu_aliases[i] != NULL; i++)
   {
     if(xstrcasecmp(name, huaray_manu_aliases[i]) == 0) return true;
   }

+ 2 - 2
ec200u/ec200u.c

@@ -170,11 +170,11 @@ int EC200U_ComInit()
 
   const char *serialName = "/dev/ttyUSB0"; int baudrate = 115200;
   const char *parityCheck = "none"; // 无校检
-  s_myCom.h = serial_open(serialName, baudrate, parityCheck, \
+  s_myCom.h = serial_open(serialName, baudrate, parityCheck,
                           comio_data_recv_proc, comio_data_recv_proc, NULL);
   if(!s_myCom.h)
   {
-    sw_log_error("[%s] failed to open the \"%s:%d(%s parity)\" device!!", \
+    sw_log_error("[%s] failed to open the \"%s:%d(%s parity)\" device!!",
                  MODULE_NAME, serialName, baudrate, parityCheck);
     EC200U_ComExit(); return -1;
   }

+ 1 - 1
hk_takephoto/takephoto.c

@@ -40,7 +40,7 @@ typedef struct
 static const char * const hikrobot_manu_aliases[] = { NULL };
 static bool is_hikrobot_manu_alias(const char *name)
 {
-  for(int i = 0; i < hikrobot_manu_aliases[i] != NULL; i++)
+  for(int i = 0; hikrobot_manu_aliases[i] != NULL; i++)
   {
     if(xstrcasecmp(name, hikrobot_manu_aliases[i]) == 0) return true;
   }

+ 4 - 4
swapi/subjects/serial/serial.c

@@ -41,7 +41,7 @@ struct serial_t
 static int serial_data_recv_proc(unsigned long wParam, unsigned long lParam);
 
 /* 打开串口(8个数据位1个停止位), NULL失败, NOT NULL成功 */
-void *serial_open(const char *serialName, int baudrate, const char *parityCheck /* "odd"-奇校检; "even"-偶校检; NULL或其它无效值-无校检 */, \
+void *serial_open(const char *serialName, int baudrate, const char *parityCheck /* "odd"-奇校检; "even"-偶校检; NULL或其它无效值-无校检 */,
                   PSerialRecvHandler pRecvHandler, PSerialIdleHandler pIdleHandler, void *pUserData)
 {
     struct serial_t *pSerial;
@@ -212,7 +212,7 @@ void serial_printf_recv_buffer(const void *hSerial, int logLevel)
     if(pSerial)
     {
         pSerial->pLogRecvBuf[0] = '\0'; // 复位日志缓存
-        sprintf(pSerial->pLogRecvBuf, "%s the received buffer has %d bytes (hex)", \
+        sprintf(pSerial->pLogRecvBuf, "%s the received buffer has %d bytes (hex)",
                 pSerial->log_prefix, pSerial->nRecvBytes);
         if(pSerial->nRecvBytes > 0) { strcat(pSerial->pLogRecvBuf, ":\n");
         xstrfromhex(pSerial->recvBuf, pSerial->nRecvBytes, pSerial->pLogRecvBuf, NULL, NULL); }
@@ -282,7 +282,7 @@ NoneP:
     { // 串口有数据
         if(pSerial->nRecvBytes >= nRecvBufSize)
         { // 判断接收缓存是否溢出
-            sw_log_warn("\"%s\" serial port receiving buffer overflow, the earliest one byte(%02x) will discard!", \
+            sw_log_warn("\"%s\" serial port receiving buffer overflow, the earliest one byte(%02x) will discard!",
                         pSerial->name, pSerial->recvBuf[0]);
             memmove(pSerial->recvBuf, pSerial->recvBuf+1, nRecvBufSize-1); // 丢弃最早的一个字节
             pSerial->nRecvBytes = nRecvBufSize-1; // 新的已接收字节数
@@ -293,7 +293,7 @@ NoneP:
         else if(nRet == 0 && errno == ETIMEDOUT) goto NoneP; // 读数据超时
         else
         { // 读一个字节错误
-            sw_log_fatal("read one byte error(ret=%d, errno=%d), \"%s\" serial port receiving thread abort!!!", \
+            sw_log_fatal("read one byte error(ret=%d, errno=%d), \"%s\" serial port receiving thread abort!!!",
                          nRet, errno, pSerial->name);
             return -1;
         }

+ 1 - 1
swapi/subjects/serial/serial.h

@@ -29,7 +29,7 @@ typedef int (*PSerialRecvHandler)(unsigned long wParam, unsigned long lParam);
 typedef int (*PSerialIdleHandler)(unsigned long wParam, unsigned long lParam);
 
 /* 打开串口(8个数据位1个停止位), NULL失败, NOT NULL成功 */
-void *serial_open(const char *serialName, int baudrate, const char *parityCheck /* "odd"-奇校检; "even"-偶校检; NULL或其它无效值-无校检 */, \
+void *serial_open(const char *serialName, int baudrate, const char *parityCheck /* "odd"-奇校检; "even"-偶校检; NULL或其它无效值-无校检 */,
                   PSerialRecvHandler pRecvHandler, PSerialIdleHandler pIdleHandler, void *pUserData);
 
 /* 关闭串口 */

+ 1 - 2
swapi/swthrdpool.c

@@ -244,6 +244,5 @@ void sw_thrdpool_printf(void *hPool)
 	int maxNum = 0, allocNum = 0, idleNum = 0, sickNum = 0, killedNum= 0;
 	if(!tp) return;
 	sw_thrdpool_get_status(tp, &maxNum, &allocNum, &idleNum, &sickNum, &killedNum);
-	sw_log_info("%p thread pool(%d): allocated=%d, idle=%d, sick=%d, killed=%d", \
-			tp, maxNum, allocNum, idleNum, sickNum, killedNum);
+	sw_log_info("%p thread pool(%d): allocated=%d, idle=%d, sick=%d, killed=%d", tp, maxNum, allocNum, idleNum, sickNum, killedNum);
 }

+ 3 - 3
ymodem/ymodem.c

@@ -140,7 +140,7 @@ int ymodem_recv_files(const char *dir)
   unsigned char file_data[PACKET_1K_SIZE]; unsigned int file_size1 = 0, file_size2 = 0;
 
   RingBuf_ctor(&s_myCom.rx_buf, s_myCom.rx_buf_storage, sizeof(s_myCom.rx_buf_storage)/sizeof(RingBufElement));
-  s_myCom.h = serial_open(UART_DEVICE_NAME, UART_BAUD_RATE, UART_PARITY_CHECK, \
+  s_myCom.h = serial_open(UART_DEVICE_NAME, UART_BAUD_RATE, UART_PARITY_CHECK,
                            comio_data_recv_proc, NULL, NULL);
   if(!s_myCom.h) return -1;
 
@@ -188,7 +188,7 @@ int ymodem_recv_files(const char *dir)
           {
             for(i = 0; i < packet_length; i++) { file_data[i] = packet_data[PACKET_HEADER+i]; }
             uart_putchar(ACK);
-            sw_log_debug("[%s] <文件: %s, 大小: %u字节> 收到第%u包数据, 数据包大小: %u字节", \
+            sw_log_debug("[%s] <文件: %s, 大小: %u字节> 收到第%u包数据, 数据包大小: %u字节",
               UART_MODULE_NAME, file_name, file_size1, packets_received, packet_length);
 
             if(!sw_dir_exists(dir)) sw_dir_create(dir);
@@ -334,7 +334,7 @@ int ymodem_send_file(const char *path)
   if(sw_file_load(path, "rb", file_buf, file_size) != file_size) { ret = -4; goto ret_p; }
 
   RingBuf_ctor(&s_myCom.rx_buf, s_myCom.rx_buf_storage, sizeof(s_myCom.rx_buf_storage)/sizeof(RingBufElement));
-  s_myCom.h = serial_open(UART_DEVICE_NAME, UART_BAUD_RATE, UART_PARITY_CHECK, \
+  s_myCom.h = serial_open(UART_DEVICE_NAME, UART_BAUD_RATE, UART_PARITY_CHECK,
                            comio_data_recv_proc, NULL, NULL);
   if(!s_myCom.h) { ret = -5; goto ret_p; }