Преглед изворни кода

Fixes for -Wundef

thanks Willy-JL
MX пре 1 година
родитељ
комит
66c500b192

+ 2 - 2
apps_source_code/rootoflife/roots_of_life_game.c

@@ -446,7 +446,7 @@ static void draw_active_root(Canvas* canvas, GameState* state) {
     }
 }
 
-#if DRAW_DEBUG
+#if defined(DRAW_DEBUG) && DRAW_DEBUG
 static void draw_generated_root(Canvas* canvas, GameState* state) {
     bool isHidden = (state->tick % BLINK_PERIOD) < BLINK_HIDE_FRAMES;
 
@@ -590,7 +590,7 @@ static void roots_draw_callback(Canvas* const canvas, void* ctx) {
 
     case StageRun:
         draw_active_root(canvas, state);
-#if DRAW_DEBUG
+#if defined(DRAW_DEBUG) && DRAW_DEBUG
         draw_generated_root(canvas, state);
 #endif
         break;

+ 1 - 1
base_pack/subbrute

@@ -1 +1 @@
-Subproject commit 7d3589d3e48327261bd212bc5a26fbe6d1eb2c74
+Subproject commit 9dc90e6a35ded220f18ad111adf5f3435b207b39

+ 2 - 0
base_pack/unitemp/interfaces/endianness.h

@@ -5,6 +5,8 @@
 #ifndef FLIPPERZERO_FIRMWARE_ENDIANNESS_H
 #define FLIPPERZERO_FIRMWARE_ENDIANNESS_H
 
+#include <machine/endian.h>
+
 inline static void store16(uint8_t* b, uint16_t i) {
     memcpy(b, &i, 2);
 }

+ 1 - 0
non_catalog_apps/FlipBIP/lib/crypto/ed25519_donna/ed25519_donna_impl_base.c

@@ -1,6 +1,7 @@
 #include <assert.h>
 #include "ed25519_donna.h"
 #include "../memzero.h"
+#include "options.h"
 
 /* sqrt(x) is such an integer y that 0 <= y <= p - 1, y % 2 = 0, and y^2 = x (mod p). */
 /* d = -121665 / 121666 */

+ 2 - 0
non_catalog_apps/FlipBIP/lib/crypto/monero/base58.h

@@ -31,6 +31,8 @@
 // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote
 // developers
 
+#include "options.h"
+
 #if USE_MONERO
 
 #ifndef __XMR_BASE58_H__

+ 2 - 0
non_catalog_apps/FlipBIP/lib/crypto/monero/serialize.c

@@ -2,6 +2,8 @@
 // Created by Dusan Klinec on 02/05/2018.
 //
 
+#include "options.h"
+
 #if USE_MONERO
 
 #include "serialize.h"

+ 2 - 0
non_catalog_apps/FlipBIP/lib/crypto/monero/xmr.c

@@ -2,6 +2,8 @@
 // Created by Dusan Klinec on 10/05/2018.
 //
 
+#include "options.h"
+
 #if USE_MONERO
 
 #include "xmr.h"

+ 2 - 2
non_catalog_apps/chess/chess/smallchesslib.h

@@ -52,7 +52,7 @@
 
 typedef uint8_t (*SCL_RandomFunction)(void);
 
-#if SCL_COUNT_EVALUATED_POSITIONS
+#if defined(SCL_COUNT_EVALUATED_POSITIONS) && SCL_COUNT_EVALUATED_POSITIONS
 uint32_t SCL_positionsEvaluated = 0; /**< If enabled by 
                                             SCL_COUNT_EVALUATED_POSITIONS, this
                                             will increment with every
@@ -2543,7 +2543,7 @@ int16_t _SCL_boardEvaluateDynamic(
     int8_t depth,
     int16_t alphaBeta,
     int8_t takenSquare) {
-#if SCL_COUNT_EVALUATED_POSITIONS
+#if defined(SCL_COUNT_EVALUATED_POSITIONS) && SCL_COUNT_EVALUATED_POSITIONS
     SCL_positionsEvaluated++;
 #endif
 

+ 1 - 1
non_catalog_apps/esp_flasher/lib/esp-serial-flasher/examples/common/example_common.c

@@ -331,7 +331,7 @@ esp_loader_error_t flash_binary(const uint8_t *bin, size_t size, size_t address)
 
     printf("\nFinished programming\n");
 
-#if MD5_ENABLED
+#if defined(MD5_ENABLED) && MD5_ENABLED
     err = esp_loader_flash_verify();
     if (err == ESP_LOADER_ERROR_UNSUPPORTED_FUNC) {
         printf("ESP8266 does not support flash verify command.");

+ 1 - 1
non_catalog_apps/esp_flasher/lib/esp-serial-flasher/include/esp_loader.h

@@ -284,7 +284,7 @@ esp_loader_error_t esp_loader_change_transmission_rate(uint32_t transmission_rat
   *     - ESP_LOADER_ERROR_INVALID_RESPONSE Internal error
   *     - ESP_LOADER_ERROR_UNSUPPORTED_FUNC Unsupported on the target
   */
-#if MD5_ENABLED
+#if defined(MD5_ENABLED) && MD5_ENABLED
 esp_loader_error_t esp_loader_flash_verify(void);
 #endif
 /**

+ 2 - 2
non_catalog_apps/esp_flasher/lib/esp-serial-flasher/src/esp_loader.c

@@ -44,7 +44,7 @@ typedef enum {
 static const target_registers_t *s_reg = NULL;
 static target_chip_t s_target = ESP_UNKNOWN_CHIP;
 
-#if MD5_ENABLED
+#if defined(MD5_ENABLED) && MD5_ENABLED
 
 static const uint32_t MD5_TIMEOUT_PER_MB = 800;
 static struct MD5Context s_md5_context;
@@ -372,7 +372,7 @@ esp_loader_error_t esp_loader_change_transmission_rate(uint32_t transmission_rat
     return loader_change_baudrate_cmd(transmission_rate);
 }
 
-#if MD5_ENABLED
+#if defined(MD5_ENABLED) && MD5_ENABLED
 
 static void hexify(const uint8_t raw_md5[16], uint8_t hex_md5_out[32])
 {

+ 5 - 5
non_catalog_apps/flipperscope/scenes/scope_scene_run.c

@@ -294,7 +294,7 @@ void AdcDmaTransferHalf_Callback() {
 
 void Activate_ADC(void) {
     __IO uint32_t wait_loop_index = 0U;
-#if(USE_TIMEOUT == 1)
+#if defined(USE_TIMEOUT) && (USE_TIMEOUT == 1)
     uint32_t Timeout = 0U; /* Variable used for timeout management */
 #endif /* USE_TIMEOUT */
     if(LL_ADC_IsEnabled(ADC1) == 0) {
@@ -307,12 +307,12 @@ void Activate_ADC(void) {
         }
         LL_ADC_StartCalibration(ADC1, LL_ADC_SINGLE_ENDED);
 
-#if(USE_TIMEOUT == 1)
+#if defined(USE_TIMEOUT) && (USE_TIMEOUT == 1)
         Timeout = ADC_CALIBRATION_TIMEOUT_MS;
 #endif /* USE_TIMEOUT */
 
         while(LL_ADC_IsCalibrationOnGoing(ADC1) != 0) {
-#if(USE_TIMEOUT == 1)
+#if defined(USE_TIMEOUT) && (USE_TIMEOUT == 1)
             if(LL_SYSTICK_IsActiveCounterFlag()) {
                 if(Timeout-- == 0) {
                 }
@@ -324,11 +324,11 @@ void Activate_ADC(void) {
             wait_loop_index--;
         }
         LL_ADC_Enable(ADC1);
-#if(USE_TIMEOUT == 1)
+#if defined(USE_TIMEOUT) && (USE_TIMEOUT == 1)
         Timeout = ADC_ENABLE_TIMEOUT_MS;
 #endif /* USE_TIMEOUT */
         while(LL_ADC_IsActiveFlag_ADRDY(ADC1) == 0) {
-#if(USE_TIMEOUT == 1)
+#if defined(USE_TIMEOUT) && (USE_TIMEOUT == 1)
             /* Check Systick counter flag to decrement the time-out value */
             if(LL_SYSTICK_IsActiveCounterFlag()) {
                 if(Timeout-- == 0) {

+ 1 - 1
non_catalog_apps/seader/lib/asn1/asn_internal.h

@@ -42,7 +42,7 @@ int get_asn1c_environment_version(void);	/* Run-time version */
  * You may enable or override it.
  */
 #ifndef	ASN_DEBUG	/* If debugging code is not defined elsewhere... */
-#if	ASN_EMIT_DEBUG == 1	/* And it was asked to emit this code... */
+#if defined(ASN_EMIT_DEBUG) && ASN_EMIT_DEBUG == 1	/* And it was asked to emit this code... */
 #if __STDC_VERSION__ >= 199901L
 #ifdef	ASN_THREAD_SAFE
 /* Thread safety requires sacrifice in output indentation:

+ 2 - 2
non_catalog_apps/wii_ec_anal/wii_anal_ec.c

@@ -41,12 +41,12 @@ bool evWiiEC(const eventMsg_t* const msg, state_t* const state) {
             break;
         }
         INFO(
-            "WIIP : %s '%c' = %d",
+            "WIIP : %s '%c' = %ld",
             s,
             (isprint((int)msg->wiiEc.in) ? msg->wiiEc.in : '_'),
             msg->wiiEc.val);
         if((msg->wiiEc.type == WIIEC_CONN) || (msg->wiiEc.type == WIIEC_DISCONN))
-            INFO("...%d=\"%s\"", msg->wiiEc.val, ecId[msg->wiiEc.val].name);
+            INFO("...%ld=\"%s\"", msg->wiiEc.val, ecId[msg->wiiEc.val].name);
     }
 #endif
 

+ 2 - 0
non_catalog_apps/wii_ec_anal/wii_ec.h

@@ -9,6 +9,8 @@
 #include "wii_ec_classic.h"
 #include "wii_ec_udraw.h"
 
+#include "bc_logging.h"
+
 //----------------------------------------------------------------------------- ----------------------------------------
 // Crypto key (PSK),      base register : {0x40..0x4F}[2][8]
 #define ENC_LEN (2 * 8)