mate-desktop / mate-power-manager

Power management tool for the MATE desktop
https://mate-desktop.org
GNU General Public License v2.0
59 stars 51 forks source link

Port from EggDebug to the built-in GLib logging framework #320

Closed rbuj closed 4 years ago

rbuj commented 4 years ago

Test 1:

$ G_MESSAGES_DEBUG=PowerManager mate-power-preferences
$ G_MESSAGES_DEBUG=PowerManager mate-power-statistics

Test 2:

$ G_MESSAGES_DEBUG=all mate-power-preferences
$ G_MESSAGES_DEBUG=all mate-power-statistics
raveit65 commented 4 years ago

All those -Wunused warnings are really a mess when you compare code with build logs as reviewer. Edit: Can you please rebase to master, maybe this makes the log readable again?

raveit65 commented 4 years ago

New debug commands are working fine in a quick test.

rbuj commented 4 years ago

It's only a git rebase master.

test: count warnings by their types

$ ./autogen.sh --enable-compile-warnings=maximum --prefix=/usr
$ make &> make.log
$ ./warnings-file.sh make.log 
-Wbad-function-cast 4
-Wdeprecated-declarations 29
-Wmissing-prototypes 6
-Wstrict-prototypes 1
-Wunused-but-set-variable 4
-Wunused-function 3
-Wunused-parameter 161

./warnings-file.sh

FILE=$1
for warning in $(grep warning $FILE | grep -Po '\[\-W.*\]' | sed 's/[][]//g' | sort -u)
do
 type=${warning#"-W"}
 num=$(echo "grep $type $FILE | wc -l" | sh)
 echo "$warning $num"
done

There is the same error count in master branch.

raveit65 commented 4 years ago

Ok, my hope died that a rebase to latest commit at master makes it better.

rbuj commented 4 years ago

@raveit65 They are scan-build warnings. We can try to remove in future.

raveit65 commented 4 years ago

It's only a git rebase master.

Yes, i know. But your PR is so big, in result i don't wanna touch it to avoid to break it ;)

raveit65 commented 4 years ago
[rave@mother mate-power-manager]$ git rebase master
First, rewinding head to replay your work on top of it...
Applying: Port from EggDebug to the built-in GLib logging framework
Using index info to reconstruct a base tree...
M   src/gpm-prefs-core.c
.git/rebase-apply/patch:1132: space before tab in indent.
          Type <command>G_MESSAGES_DEBUG=PowerManager mate-power-manager --no-daemon</command>,
warning: 1 line adds whitespace errors.
Falling back to patching base and 3-way merge...
Auto-merging src/gpm-prefs-core.c
Removing src/egg-debug.h
Removing src/egg-debug.c
Removing applets/inhibit/egg-debug.h
Removing applets/inhibit/egg-debug.c
Removing applets/brightness/egg-debug.h
Removing applets/brightness/egg-debug.c

No idea where the whitespace error is when rebasing.

rbuj commented 4 years ago

@raveit65 The whitespace error warning has been fixed.

raveit65 commented 4 years ago

Conflict after merging https://github.com/mate-desktop/mate-power-manager/commit/9f3d2d0986a6130b1cefc84caae161d75b4f56ba :/

rbuj commented 4 years ago

I fixed the merge conflict.