]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Concatenate log header strings in code
authorterencehill <piuntn@gmail.com>
Sun, 10 Feb 2019 18:38:57 +0000 (19:38 +0100)
committerterencehill <piuntn@gmail.com>
Sun, 10 Feb 2019 18:38:57 +0000 (19:38 +0100)
qcsrc/client/main.qc
qcsrc/lib/log.qh
qcsrc/lib/net.qh
qcsrc/lib/spawnfunc.qh

index e32c0e8f57568bf4f63380368cab0570a2754874..96b3caa75e3b8efbe5585da89e65ff85de0b4399 100644 (file)
@@ -801,7 +801,7 @@ NET_HANDLE(ENT_CLIENT_SPAWNEVENT, bool is_new)
 // The only parameter reflects if the entity is "new" to the client, meaning it just came into the client's PVS.
 void CSQC_Ent_Update(entity this, bool isnew)
 {
-       this.sourceLoc = __FILE__ ":" STR(__LINE__);
+       this.sourceLoc = __FILE__":"STR(__LINE__);
        int t = ReadByte();
 
        // set up the "time" global for received entities to be correct for interpolation purposes
index 4b4f7b6bd984945d961277ae148ced8dd864f4ad..94a58d0ca486636e9a917429b677f4aeb726f204 100644 (file)
@@ -43,12 +43,12 @@ string(string, string...) strcat1n = #115;
 // would be nice if __FUNC__ could be concatenated at compile time
 #if 0
        // less work, bigger binary
-       #define __SOURCELOC__ (sprintf("^7%s^9" "(" "^9"__FILE__"^7"  ":"  "^9"STR(__LINE__)"^7" ")", __FUNC__))
+       #define __SOURCELOC__ (sprintf("^7%s^9(^9"__FILE__"^7:^9"STR(__LINE__)"^7)", __FUNC__))
 #else
-       #define __SOURCELOC__ (sprintf("^7%s^9" "(" "^9%s^7"  ":"  "^9%s^7" ")", __FUNC__, __FILE__, STR(__LINE__)))
+       #define __SOURCELOC__ (sprintf("^7%s^9(^9%s^7:^9%s^7)", __FUNC__, __FILE__, STR(__LINE__)))
 #endif
 
-#define _LOG_HEADER(level) "^9[::" "^7"PROGNAME"^9" "::" level"^9" "] ", __SOURCELOC__
+#define _LOG_HEADER(level) "^9[::^7"PROGNAME"^9::"level"^9] ", __SOURCELOC__
 #define _LOG(f, level, s) \
        MACRO_BEGIN \
                f(strcat1n(_LOG_HEADER(level), "\n^7", s, "\n")); \
index 2994ea164bb1d58a9f9bee7e2a8a71ed9ad52d99..a6c363b8f7cc87e9ea337ff7b3d4aa14d95d8b6d 100644 (file)
@@ -53,7 +53,7 @@ STATIC_INIT(TempEntities_renumber) { FOREACH(TempEntities, true, it.m_id = 80 +
                ACCUMULATE NET_HANDLE(id, bool isnew) \
                { \
                        this = __self; \
-                       this.sourceLoc = __FILE__ ":" STR(__LINE__); \
+                       this.sourceLoc = __FILE__":"STR(__LINE__); \
                        if (!this) isnew = true; \
                } \
                NET_GUARD(id); \
index 37bb11768c87022e1e698137a420c6307e1bce8c..bf8eeb34b0eaafa268f24cfb7ca6e2396858352c 100644 (file)
@@ -264,7 +264,7 @@ noref bool __spawnfunc_first;
                        assert(this); \
                } \
                if (!this.sourceLoc) { \
-                       this.sourceLoc = __FILE__ ":" STR(__LINE__); \
+                       this.sourceLoc = __FILE__":"STR(__LINE__); \
                } \
                if (!this.spawnfunc_checked) { \
                        _checkWhitelisted(this, #id); \