Bug 26437 - Complete the porting to libupower-glib
Summary: Complete the porting to libupower-glib
Status: RESOLVED FIXED
Alias: None
Product: upower
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Richard Hughes
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-04 18:18 UTC by Martin Pitt
Modified: 2010-09-20 04:34 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
initial patch (broken) (50.41 KB, patch)
2010-02-04 18:18 UTC, Martin Pitt
Details | Splinter Review

Description Martin Pitt 2010-02-04 18:18:00 UTC
Created attachment 33084 [details] [review]
initial patch (broken)

Hello!

There is still some code which uses the dkp-gobject API, and the #define newname oldname compat trick does not work since the library ABI will still only have the actual dkp_* functions instead of the up_ ones.

This patch should provide 95% of the remaining porting, but it currently fails to build:

make[2]: Betrete Verzeichnis '/home/martin/upstream/upower/tools'
  CC     upower-up-tool.o
In file included from up-tool.c:34:
../src/up-device.h:26:27: error: polkit/polkit.h: No such file or directory
In file included from up-tool.c:34:
../src/up-device.h:40: error: conflicting types for ‘UpDevicePrivate’
../libupower-glib/up-device.h:43: note: previous declaration of ‘UpDevicePrivate’ was here
../src/up-device.h:46: error: conflicting types for ‘UpDevice’
../libupower-glib/up-device.h:49: note: previous declaration of ‘UpDevice’ was here
../src/up-device.h:62: error: conflicting types for ‘UpDeviceClass’
../libupower-glib/up-device.h:66: note: previous declaration of ‘UpDeviceClass’ was here
../src/up-device.h:70:1: warning: "UP_DEVICE_ERROR" redefined
In file included from ../libupower-glib/up-client.h:30,
                 from up-tool.c:33:
../libupower-glib/up-device.h:40:1: warning: this is the location of the previous definition
../src/up-device.h:76: error: conflicting types for ‘up_device_new’
../libupower-glib/up-device.h:70: note: previous declaration of ‘up_device_new’ was here
../src/up-device.h:84: error: conflicting types for ‘up_device_get_object_path’
../libupower-glib/up-device.h:89: note: previous declaration of ‘up_device_get_object_path’ was here
up-tool.c: In function ‘up_tool_device_added_cb’:
up-tool.c:72: warning: passing argument 1 of ‘up_device_get_object_path’ discards qualifiers from pointer target type
../src/up-device.h:84: note: expected ‘struct UpDevice *’ but argument is of type ‘const struct UpDevice *’
up-tool.c: In function ‘up_tool_device_changed_cb’:
up-tool.c:88: warning: passing argument 1 of ‘up_device_get_object_path’ discards qualifiers from pointer target type
../src/up-device.h:84: note: expected ‘struct UpDevice *’ but argument is of type ‘const struct UpDevice *’
up-tool.c: In function ‘up_tool_device_removed_cb’:
up-tool.c:105: warning: passing argument 1 of ‘up_device_get_object_path’ discards qualifiers from pointer target type
../src/up-device.h:84: note: expected ‘struct UpDevice *’ but argument is of type ‘const struct UpDevice *’
up-tool.c: In function ‘up_tool_show_wakeups’:
up-tool.c:189: error: ‘UpWakeupsObj’ undeclared (first use in this function)
up-tool.c:189: error: (Each undeclared identifier is reported only once
up-tool.c:189: error: for each function it appears in.)
up-tool.c:189: error: ‘obj’ undeclared (first use in this function)
up-tool.c:204: error: too few arguments to function ‘up_wakeups_get_total’
up-tool.c:208: error: too few arguments to function ‘up_wakeups_get_data’
up-tool.c:216: error: ‘up_wakeups_obj_free’ undeclared (first use in this function)
up-tool.c: In function ‘main’:
up-tool.c:288: warning: assignment makes pointer from integer without a cast
make[2]: *** [upower-up-tool.o] Fehler 1



Indeed libupower-glib/up-device.h and src/up-device.h are very similar, but not identical, and thus conflict a lot. What I don't understand is that it was similar in DKP 014, but for some mysterious reason it did not create errors there. Should we really have two instances of this code, in the lib and in src/? What is the "canonical" one?
Comment 1 Richard Hughes 2010-09-20 04:34:04 UTC
I think we're good now, thanks.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.