unicens: support reproducible build 00/22400/1
authorTobias Jahnke <tobias.jahnke@microchip.com>
Thu, 12 Sep 2019 08:23:09 +0000 (10:23 +0200)
committerTobias Jahnke <tobias.jahnke@microchip.com>
Thu, 12 Sep 2019 08:23:09 +0000 (10:23 +0200)
Changed usage of __FILE__ macro to not print absolut paths
in warning and error messages

Bug-AGL: SPEC-2802

Signed-off-by: Tobias Jahnke <tobias.jahnke@microchip.com>
Change-Id: I3755e96cb23f8c782ea00f4b4fdc7df7d08972d7

ucs2-afb/ucs_binding.c
ucs2-interface/ucs-xml/UcsXml.c
ucs2-interface/ucs-xml/UcsXml_Private.c

index 81ca3bb..777b967 100644 (file)
@@ -81,10 +81,11 @@ static EventDataRx_t *eventDataRx = NULL;
 
 PUBLIC void UcsXml_CB_OnError(const char format[], uint16_t vargsCnt, ...) {
     /*AFB_API_DEBUG (afbBindingRoot, afbIface, format, args); */
+    /*you may activite logging to stdout here
     va_list args;
     va_start (args, vargsCnt);
     vfprintf (stderr, format, args);
-    va_end(args);
+    va_end(args);*/
 
     va_list argptr;
     char outbuf[300];
index 7715cd4..5c8c346 100644 (file)
@@ -39,7 +39,8 @@
 /************************************************************************/
 
 #define COMPILETIME_CHECK(cond)  (void)sizeof(int[2 * !!(cond) - 1])
-#define RETURN_ASSERT(result) { UcsXml_CB_OnError("Assertion in file=%s, line=%d", 2, __FILE__, __LINE__); return result; }
+#define __FILENAME__ (__builtin_strrchr(__FILE__, '/') ? __builtin_strrchr(__FILE__, '/') + 1 : __FILE__)
+#define RETURN_ASSERT(result) { UcsXml_CB_OnError("Assertion in file=%s, line=%d", 2, __FILENAME__, __LINE__); return result; }
 #define MISC_HB(value)      ((uint8_t)((uint16_t)(value) >> 8))
 #define MISC_LB(value)      ((uint8_t)((uint16_t)(value) & (uint16_t)0xFF))
 #define ROUTE_AUTO_ID_START (0x8000)
@@ -1636,4 +1637,3 @@ static bool IsAutoRouteId(uint16_t id, PrivateData_t *priv)
     assert(NULL != priv);
     return (id >= ROUTE_AUTO_ID_START && id <= priv->autoRouteId);
 }
-
index 4fb4e0c..a1ef86c 100644 (file)
@@ -66,7 +66,8 @@ static const char* I2S_PIN_SRXB1 =          "SRXB1";
 static const char* MUTE_OFF =               "NoMuting";\r
 static const char* MUTE_SIGNAL =            "MuteSignal";\r
 \r
-#define ASSERT_FALSE(func, par) { UcsXml_CB_OnError("Parameter error in attribute=%s value=%s, file=%s, line=%d", 4, func, par,  __FILE__, __LINE__); return false; }\r
+#define __FILENAME__ (__builtin_strrchr(__FILE__, '/') ? __builtin_strrchr(__FILE__, '/') + 1 : __FILE__)\r
+#define ASSERT_FALSE(func, par) { UcsXml_CB_OnError("Parameter error in attribute=%s value=%s, file=%s, line=%d", 4, func, par,  __FILENAME__, __LINE__); return false; }\r
 #define CHECK_POINTER(PTR) if (NULL == PTR) { ASSERT_FALSE(PTR, "NULL pointer"); }\r
 \r
 static int32_t Str2Int(const char *val)\r