changeset 166:255eedad4155 cleanup-1

cleanup: get rid of some compile warnings Compiling with -Wall and not taking action on produced warnings is pretty useless. This fixes chars used as array indexes, and using the NULL pointer as a 0 constant. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
author Jan Mulder <jlmulder@xs4all.nl>
date Thu, 07 Mar 2019 21:52:23 +0100
parents 3e3d1ebba956
children 5e41365ff0d8
files Discovery/Src/show_logbook.c Discovery/Src/t3.c Discovery/Src/t4_tetris.c Discovery/Src/t5_gauge.c Discovery/Src/t6_apnea.c Discovery/Src/t7.c Discovery/Src/tComm.c Discovery/Src/tInfo.c Discovery/Src/tMenuEdit.c Discovery/Src/tMenuEditPlanner.c Discovery/Src/tMenuEditSetpoint.c
diffstat 11 files changed, 25 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/Discovery/Src/show_logbook.c	Thu Mar 07 14:15:33 2019 +0000
+++ b/Discovery/Src/show_logbook.c	Thu Mar 07 21:52:23 2019 +0100
@@ -232,7 +232,7 @@
                     colortemp[i] = CLUT_NiceGreen;
                 }
             }
-            GFX_graph_print(hgfx,&wintemp,saveTop,1,0,datamax, decostopdata,dataLength, NULL, colortemp);
+            GFX_graph_print(hgfx,&wintemp,saveTop,1,0,datamax, decostopdata,dataLength, 0, colortemp);
         }
         else
             GFX_graph_print(hgfx,&wintemp,saveTop,1,0,datamax, decostopdata,dataLength, CLUT_NiceGreen, NULL);
--- a/Discovery/Src/t3.c	Thu Mar 07 14:15:33 2019 +0000
+++ b/Discovery/Src/t3.c	Thu Mar 07 21:52:23 2019 +0100
@@ -181,7 +181,7 @@
 
     t3screen.FBStartAdress = getFrame(24);
     t3_refresh_divemode();
-    GFX_SetFramesTopBottom(t3screen.FBStartAdress, NULL,480);
+    GFX_SetFramesTopBottom(t3screen.FBStartAdress, 0,480);
     releaseAllFramesExcept(24,t3screen.FBStartAdress);
 }
 
--- a/Discovery/Src/t4_tetris.c	Thu Mar 07 14:15:33 2019 +0000
+++ b/Discovery/Src/t4_tetris.c	Thu Mar 07 21:52:23 2019 +0100
@@ -120,7 +120,7 @@
 
     t4screen.FBStartAdress = getFrame(25);
     t4_refresh_divemode();
-    GFX_SetFramesTopBottom(t4screen.FBStartAdress, NULL,480);
+    GFX_SetFramesTopBottom(t4screen.FBStartAdress, 0,480);
     releaseAllFramesExcept(25,t4screen.FBStartAdress);
 }
 
--- a/Discovery/Src/t5_gauge.c	Thu Mar 07 14:15:33 2019 +0000
+++ b/Discovery/Src/t5_gauge.c	Thu Mar 07 21:52:23 2019 +0100
@@ -187,7 +187,7 @@
         set_globalState(StD);
 
     t5_refresh_divemode();
-    GFX_SetFramesTopBottom(t5screen.FBStartAdress, NULL,480);
+    GFX_SetFramesTopBottom(t5screen.FBStartAdress, 0,480);
     releaseAllFramesExcept(24,t5screen.FBStartAdress);
 }
 
--- a/Discovery/Src/t6_apnea.c	Thu Mar 07 14:15:33 2019 +0000
+++ b/Discovery/Src/t6_apnea.c	Thu Mar 07 21:52:23 2019 +0100
@@ -183,7 +183,7 @@
         set_globalState(StD);
 
     t6_refresh_divemode();
-    GFX_SetFramesTopBottom(t6screen.FBStartAdress, NULL,480);
+    GFX_SetFramesTopBottom(t6screen.FBStartAdress, 0,480);
     releaseAllFramesExcept(24,t6screen.FBStartAdress);
 }
 
--- a/Discovery/Src/t7.c	Thu Mar 07 14:15:33 2019 +0000
+++ b/Discovery/Src/t7.c	Thu Mar 07 21:52:23 2019 +0100
@@ -109,7 +109,7 @@
 
 SBackground background =
 {
-    .pointer = NULL,
+    .pointer = 0,
 };
 
 
@@ -544,7 +544,7 @@
 
     if(get_globalState() == StStop)
     {
-        GFX_SetFramesTopBottom(t7screen.FBStartAdress, NULL,480);
+        GFX_SetFramesTopBottom(t7screen.FBStartAdress, 0,480);
     }
     releaseFrame(22,oldScreen);
 }
@@ -624,7 +624,7 @@
             GFX_SetFrameBottom(background.pointer,background.x0 , background.y0, background.width, background.height);
         }
         else
-            GFX_SetFramesTopBottom(t7screen.FBStartAdress, NULL,480);
+            GFX_SetFramesTopBottom(t7screen.FBStartAdress, 0,480);
     }
 
     releaseAllFramesExcept(22,t7screen.FBStartAdress);
@@ -2444,7 +2444,7 @@
     if(stateUsed->warnings.numWarnings)
         customview_warnings = t7_test_customview_warnings();
 
-    background.pointer = NULL;
+    background.pointer = 0;
     if(customview_warnings && warning_count_high_time)
         t7_show_customview_warnings();
     else
--- a/Discovery/Src/tComm.c	Thu Mar 07 14:15:33 2019 +0000
+++ b/Discovery/Src/tComm.c	Thu Mar 07 21:52:23 2019 +0100
@@ -123,7 +123,6 @@
 uint8_t receive_update_data_mainCPU_firmware_subrotuine(uint8_t region, uint8_t* pBuffer1, uint8_t* pBuffer2);
 HAL_StatusTypeDef receive_uart_large_size(UART_HandleTypeDef *huart, uint8_t *pData, uint32_t Size);
 static uint8_t openComm(uint8_t aRxByte);
-uint8_t tComm_Set_Bluetooth_Name_sub(uint16_t serial);
 uint8_t HW_Set_Bluetooth_Name(uint16_t serial, uint8_t withEscapeSequence);
 uint8_t prompt4D4C(uint8_t mode);
 
@@ -219,7 +218,7 @@
             GFX_write_string(&FontT48, &tCwindow, "Service mode enabled",2);
         else
             GFX_write_string(&FontT48, &tCwindow, "Download mode enabled",2);
-        GFX_SetFramesTopBottom(tCscreen.FBStartAdress, NULL,480);
+        GFX_SetFramesTopBottom(tCscreen.FBStartAdress, 0,480);
         display_text[0] = 0;
         display_text[255] = 0;
     }
--- a/Discovery/Src/tInfo.c	Thu Mar 07 14:15:33 2019 +0000
+++ b/Discovery/Src/tInfo.c	Thu Mar 07 21:52:23 2019 +0100
@@ -148,7 +148,7 @@
     tIscreen.FBStartAdress = getFrame(14);
 
 //	GFX_SetFramesTopBottom(tIscreen.FBStartAdress, tIcursor.FBStartAdress,480);
-    GFX_SetFramesTopBottom(tIscreen.FBStartAdress, NULL,480);
+    GFX_SetFramesTopBottom(tIscreen.FBStartAdress, 0,480);
     infoColor = CLUT_InfoSurface;
 
     if(modeToStart == StIDEBUG)
@@ -218,7 +218,7 @@
         refreshInfo_Compass();
 
     if(inDebugMode() || (get_globalState() == StICOMPASS)) /* could be timeout and exitInfo */
-        GFX_SetFramesTopBottom(tIscreen.FBStartAdress, NULL,480);
+        GFX_SetFramesTopBottom(tIscreen.FBStartAdress, 0,480);
 
     if(oldIscreen)
         releaseFrame(14,oldIscreen);
@@ -534,7 +534,7 @@
 
     change_CLUT_entry((CLUT_InfoField0 + TIid), CLUT_InfoButtonColor1);
 
-    if(editID == NULL)
+    if(editID == 0)
         tInfo_write_content_without_Id();
     else
     {
@@ -571,7 +571,7 @@
 
     change_CLUT_entry((CLUT_InfoField0 + TIid), CLUT_InfoButtonColor1);
 
-    if(editID == NULL)
+    if(editID == 0)
         tInfo_write_content_without_Id();
     else
     {
@@ -607,7 +607,7 @@
     else
         change_CLUT_entry((CLUT_InfoField0 + TIid), CLUT_InfoInActive);
 
-    if(editID == NULL)
+    if(editID == 0)
         tInfo_write_content_without_Id();
     else
     {
--- a/Discovery/Src/tMenuEdit.c	Thu Mar 07 14:15:33 2019 +0000
+++ b/Discovery/Src/tMenuEdit.c	Thu Mar 07 21:52:23 2019 +0100
@@ -1252,7 +1252,7 @@
 
     create_newText_for_actual_Id();
 
-    if(editID == NULL)
+    if(editID == 0)
         write_content_without_Id();
     else
     {
@@ -1334,7 +1334,7 @@
 
     create_newText_for_actual_Id();
 
-    if(editID == NULL)
+    if(editID == 0)
         write_content_without_Id();
     else
     {
@@ -1366,7 +1366,7 @@
 
     change_CLUT_entry((CLUT_MenuEditField0 + id), CLUT_MenuEditButtonColor1);
 
-    if(editID == NULL)
+    if(editID == 0)
         write_content_without_Id();
     else
     {
@@ -1404,7 +1404,7 @@
 
     change_CLUT_entry((CLUT_MenuEditField0 + id), CLUT_MenuEditButtonColor1);
 
-    if(editID == NULL)
+    if(editID == 0)
         write_content_without_Id();
     else
     {
@@ -1463,7 +1463,7 @@
     else
         change_CLUT_entry((CLUT_MenuEditField0 + id), CLUT_MenuEditInfo);
 
-    if(editID == NULL)
+    if(editID == 0)
         write_content_without_Id();
     else
     {
@@ -1496,7 +1496,7 @@
 
     change_CLUT_entry((CLUT_MenuEditField0 + id), CLUT_MenuEditFieldRegular);
 
-    if(editID == NULL)
+    if(editID == 0)
         write_content_without_Id();
     else
     {
--- a/Discovery/Src/tMenuEditPlanner.c	Thu Mar 07 14:15:33 2019 +0000
+++ b/Discovery/Src/tMenuEditPlanner.c	Thu Mar 07 21:52:23 2019 +0100
@@ -517,7 +517,8 @@
 
 void refresh_PlanResult(void)
 {
-    char text[256], textpointer;
+    char text[256];
+    uint8_t textpointer;
     uint16_t y_line;
     uint8_t oxygen_percentage;
     int now;
--- a/Discovery/Src/tMenuEditSetpoint.c	Thu Mar 07 14:15:33 2019 +0000
+++ b/Discovery/Src/tMenuEditSetpoint.c	Thu Mar 07 21:52:23 2019 +0100
@@ -180,7 +180,8 @@
         /* surface mode */
         uint8_t spId, setpoint_cbar, sp_high, depthDeco, first;
         // uint8_t active,
-        char text[70], textPointer;
+        char text[70];
+        uint8_t textPointer;
         uint16_t y_line;
 
         set_globalState_Menu_Line(line);