HarveyHunt / howm

A lightweight, X11 tiling window manager that behaves like vim
GNU General Public License v2.0
649 stars 24 forks source link

This commit fixes all the remaining warnings #15

Closed anubhavcodes closed 9 years ago

anubhavcodes commented 9 years ago

For the discarding const pointer warning,term_cmd was const char _const, and we were trying to assign that to const char . So I changed the const char _cmd to a const char * const * const cmd Sounds confusing? Declare cmd as a const pointer to const pointer to const char, that's all we did and the warning disappears.

For the other warning, initialization makes integer from pointer without a cast, initializing the first member of the wss[] array as NULL, was actually interpreted by the compiler as assigning the first member of the struct (which happens to be an int) to NULL, and NULL happens to be a pointer and hence NULL was not compatible with an int.

So changing the NULL value to 0 fixed the warning. I have tested the binary a little and there seems to be no crashes as of yet.

What I want to know is, you intention behind assigning the first member of the array wss[] as NULL? Were you trying to make all the members of the struct Workspace as NULL, or just the first member of ie int layout as NULL. If you were trying the former, we need to assign all the NULL eqvivalents of ints and unsigned ints there.

Now I should focus on the clang warnings.

anubhavcodes commented 9 years ago

There are no warnings on my side of make. However there are two new warnings on Travis CI, which can be fixed easily after I know your intention behind this static Workspace wss[] = { { NULL } , .... ... };

Did you want to assign the whole first member of wss as NULL, or the only the firstMember.layout as NULL?

HarveyHunt commented 9 years ago

Thanks for the PR, it looks good.

My intention was to have the first member of wss as NULL (howm counts workspaces from 1 so I wanted wss to be the same).

anubhavcodes commented 9 years ago

So I will have to make all the other values of the first member as NULL, I will do that.

HarveyHunt commented 9 years ago

Thanks neo, I'll merge this when it is done- great work!

HarveyHunt commented 9 years ago

This looks good, Travis reports no warnings for both clang and gcc. Thanks for doing this. :+1:

anubhavcodes commented 9 years ago

Wow clang was a complete suprise!! :)