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

silence and address warnings

Joseph пре 3 година
родитељ
комит
c8c9288e3b
8 измењених фајлова са 122 додато и 6 уклоњено
  1. 100 0
      1
  2. 17 0
      compile_log
  3. 3 2
      config.def.h
  4. 0 2
      config.h
  5. 1 1
      drw.c
  6. 1 1
      drw.h
  7. BIN
      dwm
  8. BIN
      dwm.o

+ 100 - 0
1

@@ -0,0 +1,100 @@
+rm -f dwm drw.o dwm.o util.o dwm-6.3.tar.gz
+dwm build options:
+CFLAGS   = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os -I/usr/X11R6/include -I/usr/include/freetype2 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L -DVERSION="6.3" -DXINERAMA
+LDFLAGS  = -L/usr/X11R6/lib -lX11 -lXinerama -lfontconfig -lXft -lXrender
+CC       = cc
+cc -c -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os -I/usr/X11R6/include -I/usr/include/freetype2 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L -DVERSION=\"6.3\" -DXINERAMA drw.c
+cc -c -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os -I/usr/X11R6/include -I/usr/include/freetype2 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L -DVERSION=\"6.3\" -DXINERAMA dwm.c
+In file included from dwm.c:333:
+config.h:26:9: warning: braces around scalar initializer
+   26 |         [SchemeNorm] = { OPAQUE, baralpha, borderalpha },
+      |         ^
+config.h:26:9: note: (near initialization for ‘alphas[0]’)
+dwm.c:61:33: warning: initialization of ‘unsigned int *’ from ‘unsigned int’ makes pointer from integer without a cast [-Wint-conversion]
+   61 | #define OPAQUE                  0xffU
+      |                                 ^~~~~
+config.h:26:26: note: in expansion of macro ‘OPAQUE’
+   26 |         [SchemeNorm] = { OPAQUE, baralpha, borderalpha },
+      |                          ^~~~~~
+dwm.c:61:33: note: (near initialization for ‘alphas[0]’)
+   61 | #define OPAQUE                  0xffU
+      |                                 ^~~~~
+config.h:26:26: note: in expansion of macro ‘OPAQUE’
+   26 |         [SchemeNorm] = { OPAQUE, baralpha, borderalpha },
+      |                          ^~~~~~
+In file included from dwm.c:333:
+config.h:26:34: warning: excess elements in scalar initializer
+   26 |         [SchemeNorm] = { OPAQUE, baralpha, borderalpha },
+      |                                  ^~~~~~~~
+config.h:26:34: note: (near initialization for ‘alphas[0]’)
+config.h:26:44: warning: excess elements in scalar initializer
+   26 |         [SchemeNorm] = { OPAQUE, baralpha, borderalpha },
+      |                                            ^~~~~~~~~~~
+config.h:26:44: note: (near initialization for ‘alphas[0]’)
+config.h:27:9: warning: braces around scalar initializer
+   27 |         [SchemeSel]  = { OPAQUE, baralpha, borderalpha },
+      |         ^
+config.h:27:9: note: (near initialization for ‘alphas[1]’)
+dwm.c:61:33: warning: initialization of ‘unsigned int *’ from ‘unsigned int’ makes pointer from integer without a cast [-Wint-conversion]
+   61 | #define OPAQUE                  0xffU
+      |                                 ^~~~~
+config.h:27:26: note: in expansion of macro ‘OPAQUE’
+   27 |         [SchemeSel]  = { OPAQUE, baralpha, borderalpha },
+      |                          ^~~~~~
+dwm.c:61:33: note: (near initialization for ‘alphas[1]’)
+   61 | #define OPAQUE                  0xffU
+      |                                 ^~~~~
+config.h:27:26: note: in expansion of macro ‘OPAQUE’
+   27 |         [SchemeSel]  = { OPAQUE, baralpha, borderalpha },
+      |                          ^~~~~~
+In file included from dwm.c:333:
+config.h:27:34: warning: excess elements in scalar initializer
+   27 |         [SchemeSel]  = { OPAQUE, baralpha, borderalpha },
+      |                                  ^~~~~~~~
+config.h:27:34: note: (near initialization for ‘alphas[1]’)
+config.h:27:44: warning: excess elements in scalar initializer
+   27 |         [SchemeSel]  = { OPAQUE, baralpha, borderalpha },
+      |                                            ^~~~~~~~~~~
+config.h:27:44: note: (near initialization for ‘alphas[1]’)
+dwm.c: In function ‘setup’:
+dwm.c:1774:55: warning: passing argument 2 of ‘drw_scm_create’ from incompatible pointer type [-Wincompatible-pointer-types]
+ 1774 |                 scheme[i] = drw_scm_create(drw, colors[i], alphas[i], 3);
+      |                                                 ~~~~~~^~~
+      |                                                       |
+      |                                                       char **
+In file included from dwm.c:45:
+drw.h:45:43: note: expected ‘const char **’ but argument is of type ‘char **’
+   45 | Clr *drw_scm_create(Drw *drw, const char *clrnames[], const unsigned int alphas[], size_t clrcount);
+      |                               ~~~~~~~~~~~~^~~~~~~~~~
+In function ‘setup’,
+    inlined from ‘main’ at dwm.c:2820:2:
+dwm.c:1774:29: warning: ‘drw_scm_create’ reading 4 bytes from a region of size 0 [-Wstringop-overread]
+ 1774 |                 scheme[i] = drw_scm_create(drw, colors[i], alphas[i], 3);
+      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+dwm.c: In function ‘main’:
+dwm.c:1774:29: note: referencing argument 3 of type ‘const unsigned int *’
+In file included from dwm.c:45:
+drw.h:45:6: note: in a call to function ‘drw_scm_create’
+   45 | Clr *drw_scm_create(Drw *drw, const char *clrnames[], const unsigned int alphas[], size_t clrcount);
+      |      ^~~~~~~~~~~~~~
+In function ‘setup’,
+    inlined from ‘main’ at dwm.c:2820:2:
+dwm.c:1774:29: warning: ‘drw_scm_create’ reading 4 bytes from a region of size 0 [-Wstringop-overread]
+ 1774 |                 scheme[i] = drw_scm_create(drw, colors[i], alphas[i], 3);
+      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+dwm.c: In function ‘main’:
+dwm.c:1774:29: note: referencing argument 3 of type ‘const unsigned int *’
+In file included from dwm.c:45:
+drw.h:45:6: note: in a call to function ‘drw_scm_create’
+   45 | Clr *drw_scm_create(Drw *drw, const char *clrnames[], const unsigned int alphas[], size_t clrcount);
+      |      ^~~~~~~~~~~~~~
+cc -c -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os -I/usr/X11R6/include -I/usr/include/freetype2 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L -DVERSION=\"6.3\" -DXINERAMA util.c
+cc -o dwm drw.o dwm.o util.o -L/usr/X11R6/lib -lX11 -lXinerama -lfontconfig -lXft -lXrender
+mkdir -p /usr/local/bin
+cp -f dwm /usr/local/bin
+chmod 755 /usr/local/bin/dwm
+cp -f dwmswallow /usr/local/bin
+chmod 755 /usr/local/bin/dwmswallow
+mkdir -p /usr/local/share/man/man1
+sed "s/VERSION/6.3/g" < dwm.1 > /usr/local/share/man/man1/dwm.1
+chmod 644 /usr/local/share/man/man1/dwm.1

+ 17 - 0
compile_log

@@ -0,0 +1,17 @@
+rm -f dwm drw.o dwm.o util.o dwm-6.3.tar.gz
+dwm build options:
+CFLAGS   = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os -I/usr/X11R6/include -I/usr/include/freetype2 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L -DVERSION="6.3" -DXINERAMA
+LDFLAGS  = -L/usr/X11R6/lib -lX11 -lXinerama -lfontconfig -lXft -lXrender
+CC       = cc
+cc -c -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os -I/usr/X11R6/include -I/usr/include/freetype2 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L -DVERSION=\"6.3\" -DXINERAMA drw.c
+cc -c -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os -I/usr/X11R6/include -I/usr/include/freetype2 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L -DVERSION=\"6.3\" -DXINERAMA dwm.c
+cc -c -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os -I/usr/X11R6/include -I/usr/include/freetype2 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L -DVERSION=\"6.3\" -DXINERAMA util.c
+cc -o dwm drw.o dwm.o util.o -L/usr/X11R6/lib -lX11 -lXinerama -lfontconfig -lXft -lXrender
+mkdir -p /usr/local/bin
+cp -f dwm /usr/local/bin
+chmod 755 /usr/local/bin/dwm
+cp -f dwmswallow /usr/local/bin
+chmod 755 /usr/local/bin/dwmswallow
+mkdir -p /usr/local/share/man/man1
+sed "s/VERSION/6.3/g" < dwm.1 > /usr/local/share/man/man1/dwm.1
+chmod 644 /usr/local/share/man/man1/dwm.1

+ 3 - 2
config.def.h

@@ -87,8 +87,9 @@ ResourcePref resources[] = {
 		{ "selbordercolor",     STRING,  &selbordercolor },
 		{ "selfgcolor",         STRING,  &selfgcolor },
 		{ "borderalpha",        INTEGER, &borderalpha },
-		{ "baralpha",          	INTEGER, &baralpha },
-		{ "borderpx",          	INTEGER, &borderpx },
+//		{ "baralpha",          	INTEGER, &baralpha },
+//		{ "borderpx",          	INTEGER, &borderpx },
+// TODO: figure out how to add these
 		{ "snap",          	INTEGER, &snap },
 		{ "showbar",          	INTEGER, &showbar },
 		{ "topbar",          	INTEGER, &topbar },

+ 0 - 2
config.h

@@ -86,8 +86,6 @@ ResourcePref resources[] = {
 		{ "selbgcolor",         STRING,  &selbgcolor },
 		{ "selbordercolor",     STRING,  &selbordercolor },
 		{ "selfgcolor",         STRING,  &selfgcolor },
-		{ "borderalpha",        INTEGER, &borderalpha },
-		{ "baralpha",          	INTEGER, &baralpha },
 		{ "borderpx",          	INTEGER, &borderpx },
 		{ "snap",          	INTEGER, &snap },
 		{ "showbar",          	INTEGER, &showbar },

+ 1 - 1
drw.c

@@ -211,7 +211,7 @@ drw_clr_create(Drw *drw, Clr *dest, const char *clrname, unsigned int alpha)
 /* Wrapper to create color schemes. The caller has to call free(3) on the
  * returned color scheme when done using it. */
 Clr *
-drw_scm_create(Drw *drw, const char *clrnames[], const unsigned int alphas[], size_t clrcount)
+drw_scm_create(Drw *drw, char *clrnames[], const unsigned int alphas[], size_t clrcount)
 {
 	size_t i;
 	Clr *ret;

+ 1 - 1
drw.h

@@ -42,7 +42,7 @@ void drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned in
 
 /* Colorscheme abstraction */
 void drw_clr_create(Drw *drw, Clr *dest, const char *clrname, unsigned int alpha);
-Clr *drw_scm_create(Drw *drw, const char *clrnames[], const unsigned int alphas[], size_t clrcount);
+Clr *drw_scm_create(Drw *drw, char *clrnames[], const unsigned int alphas[], size_t clrcount);
 
 /* Cursor abstraction */
 Cur *drw_cur_create(Drw *drw, int shape);