Skip to content

Commit 23c9aff

Browse files
authored
Fix gcc compiler warnings
... like these: MainDocument.cpp: In member function ‘void CMainDocument::KillGraphicsApp(int)’: MainDocument.cpp:1715:19: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 1715 | argv[0] = "switcher"; | ^~~~~~~~~~ MainDocument.cpp: In function ‘void color_cycle(int, int, wxColour&)’: MainDocument.cpp:2655:42: warning: ‘b’ may be used uninitialized [-Wmaybe-uninitialized] 2655 | unsigned char cb = (unsigned char) (b*256);
1 parent 76dffd0 commit 23c9aff

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

clientgui/MainDocument.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1712,10 +1712,10 @@ void CMainDocument::KillGraphicsApp(int pid) {
17121712

17131713
if (g_use_sandbox) {
17141714
snprintf(thePIDbuf, sizeof(thePIDbuf), "%d", pid);
1715-
argv[0] = "switcher";
1716-
argv[1] = "/bin/kill";
1717-
argv[2] = "kill";
1718-
argv[3] = "-KILL";
1715+
argv[0] = (char *)"switcher";
1716+
argv[1] = (char *)"/bin/kill";
1717+
argv[2] = (char *)"kill";
1718+
argv[3] = (char *)"-KILL";
17191719
argv[4] = thePIDbuf;
17201720
argv[5] = 0;
17211721

@@ -1767,7 +1767,7 @@ int CMainDocument::WorkShowGraphics(RESULT* rp) {
17671767
#ifndef __WXMSW__
17681768
char* argv[4];
17691769

1770-
argv[0] = "switcher";
1770+
argv[0] = (char *)"switcher";
17711771
// For unknown reasons on Macs, the graphics application
17721772
// exits with "RegisterProcess failed (error = -50)" unless
17731773
// we pass its full path twice in the argument list to execv.
@@ -2645,7 +2645,7 @@ static void hsv2rgb(
26452645
//
26462646
void color_cycle(int i, int n, wxColour& color) {
26472647
double h = (double)i/(double)n;
2648-
double r, g, b;
2648+
double r = 0.0, g = 0.0, b = 0.0;
26492649
double v = .75;
26502650
if (n > 6) v = .6 + (i % 3)*.1;
26512651
// cycle through 3 different brightnesses

0 commit comments

Comments
 (0)