Skip to content

Commit

Permalink
Suppress compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Toodles2You committed Sep 15, 2022
1 parent 742703e commit 647125c
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 10 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ include_directories(

if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
add_compile_options(
-Wno-write-strings
-DSYSTEM_POSIX
-DSTDC_HEADERS
-DHAVE_FCNTL_H
Expand Down
2 changes: 1 addition & 1 deletion src/sdhlt/common/filelib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ long getfiledata(const char* const filename, char* buffer, const int
}
_close(handle);
time(&end);
Log("%10.3fMB] (%d)\n", size / (1024.0 * 1024.0), end - start);
Log("%10.3fMB] (%li)\n", size / (1024.0 * 1024.0), end - start);
}

if (buffersize != size)
Expand Down
6 changes: 3 additions & 3 deletions src/sdhlt/common/log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ void CDECL FORMAT_PRINTF(2,3) Fatal(assume_msgs msgid, const char* const wa
const MessageTable_t* msg = GetAssume(msgid);

safe_snprintf(message, MAX_MESSAGE, "%s\n%s%s\n%s%s\n", Localize (msg->title), Localize ("Description: "), Localize (msg->text), Localize ("Howto Fix: "), Localize (msg->howto));
PrintOnce(message);
PrintOnce("%s", message);
}

fatal = 1;
Expand Down Expand Up @@ -517,7 +517,7 @@ static void DisplayDeveloperLevel()
if (g_developer)
{
safe_strncat(message, "]\n", MAX_MESSAGE);
Log(message);
Log("%s", message);
}
}

Expand Down Expand Up @@ -610,7 +610,7 @@ void hlassume(bool exp, assume_msgs msgid)
const MessageTable_t* msg = GetAssume(msgid);

safe_snprintf(message, MAX_MESSAGE, "%s\n%s%s\n%s%s\n", Localize (msg->title), Localize ("Description: "), Localize (msg->text), Localize ("Howto Fix: "), Localize (msg->howto));
Error(message);
Error("%s", message);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/sdhlt/common/threads.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ void RunThreadsOn(int workcnt, bool showpacifier, q_threadfunction fu

for (i = 0; i < g_numthreads; i++)
{
if (pthread_create(&work_threads[i], &attrib, ThreadEntryStub, (void*)i) == -1)
if (pthread_create(&work_threads[i], &attrib, ThreadEntryStub, (void*)(intptr_t)i) == -1)
{
Error("pthread_create failed");
}
Expand Down
4 changes: 2 additions & 2 deletions src/sdhlt/sdHLRAD/lightmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void AddFaceForVertexNormal_printerror (const int edgeabs, const int edgeend, df
e = g_dsurfedges[f->firstedge + i];
edgeshare_t *es = &g_edgeshare[abs(e)];
int v0 = g_dedges[abs(e)].v[0], v1 = g_dedges[abs(e)].v[1];
Log (" e=%d v0=%d(%f,%f,%f) v1=%d(%f,%f,%f) share0=%d share1=%d\n", e,
Log (" e=%d v0=%d(%f,%f,%f) v1=%d(%f,%f,%f) share0=%li share1=%li\n", e,
v0, g_dvertexes[v0].point[0], g_dvertexes[v0].point[1], g_dvertexes[v0].point[2],
v1, g_dvertexes[v1].point[0], g_dvertexes[v1].point[1], g_dvertexes[v1].point[2],
(es->faces[0]==NULL? -1: es->faces[0]-g_dfaces), (es->faces[1]==NULL? -1: es->faces[1]-g_dfaces));
Expand Down Expand Up @@ -643,7 +643,7 @@ static void CalcFaceExtents(lightinfo_t* l)
)
{
ThreadLock();
PrintOnce("\nfor Face %d (texture %s) at ", s - g_dfaces, TextureNameFromFace(s));
PrintOnce("\nfor Face %li (texture %s) at ", s - g_dfaces, TextureNameFromFace(s));

for (i = 0; i < s->numedges; i++)
{
Expand Down
6 changes: 5 additions & 1 deletion src/sdhlt/sdHLRAD/qrad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2863,7 +2863,11 @@ static void Settings()
safe_snprintf(buf2, sizeof(buf2), "%3.3f", DEFAULT_SMOOTHING_VALUE);
Log("smoothing threshold [ %17s ] [ %17s ]\n", buf1, buf2);
safe_snprintf(buf1, sizeof(buf1), g_smoothing_value_2<0? "no change": "%3.3f", g_smoothing_value_2);
safe_snprintf(buf2, sizeof(buf2), DEFAULT_SMOOTHING2_VALUE<0? "no change": "%3.3f", DEFAULT_SMOOTHING2_VALUE);
#if DEFAULT_SMOOTHING2_VALUE
safe_snprintf(buf2, sizeof(buf2), "%3.3f", DEFAULT_SMOOTHING2_VALUE);
#else
safe_snprintf(buf2, sizeof(buf2), "no change");
#endif
Log("smoothing threshold 2[ %17s ] [ %17s ]\n", buf1, buf2);
safe_snprintf(buf1, sizeof(buf1), "%3.3f", g_dlight_threshold);
safe_snprintf(buf2, sizeof(buf2), "%3.3f", DEFAULT_DLIGHT_THRESHOLD);
Expand Down
2 changes: 1 addition & 1 deletion src/sdhlt/sdHLRAD/qrad.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
#define DEFAULT_DLIGHT_THRESHOLD 10.0
#define DEFAULT_DLIGHT_SCALE 1.0 //2.0 //vluzacn
#define DEFAULT_SMOOTHING_VALUE 50.0
#define DEFAULT_SMOOTHING2_VALUE -1.0
#define DEFAULT_SMOOTHING2_VALUE 0
#define DEFAULT_INCREMENTAL false


Expand Down
2 changes: 1 addition & 1 deletion src/sdhlt/sdRIPENT/ripent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ void ParseEntityData(const char *cTab, int iTabLength, const char *cNewLine, int
// a message, print it.
if(*cError != '\0')
{
Error(cError);
Error("%s", cError);
}
Error("unknowen exception.");

Expand Down

0 comments on commit 647125c

Please sign in to comment.