[Digikam-devel] [Bug 129610] New: digikam: unsupported initialization of CameraList object

Achim Bohnet ach at mpe.mpg.de
Wed Jun 21 21:20:28 BST 2006


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=129610         
           Summary: digikam: unsupported initialization of CameraList object
           Product: digikam
           Version: unspecified
          Platform: unspecified
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: NOR
         Component: general
        AssignedTo: digikam-devel kde org
        ReportedBy: ach mpe mpg de


Version:           0.8.2-rc1 (using KDE 3.5.2, Kubuntu Package 4:3.5.2-0ubuntu18 dapper)
Compiler:          Target: i486-linux-gnu
OS:                Linux (i686) release 2.6.15-25-686

While checking the diff between 2.1.6 and 2.2 headers I stumpled
over this:

+/* Usage pattern for CameraList for users external of
+ * libgphoto2, such as libgphoto2 frontends:
+ *
+ *    CameraList *list;
+ *    gp_list_new (&list);
+ *    init_list_somehow (list);
+ *    for (i=0; i < gp_list_count(list); i++) {
+ *        char *name, *value;
+ *        gp_list_get_name (list, i, &name);
+ *        gp_list_get_name (list, i, &value);
+ *        do_something_with (name, value);
+ *    }
+ *    gp_list_free (list);
+ *
+ * Please do NOT directly instantiate a CameraList object like this:
+ *               CameraList foo;     // DO NOT DO THIS
+ * Please do NOT directly access the structure members like this:
+ *               list->entry[i].name // DO NOT DO THIS
+ */

Grep on sources in trunk:

$ grep -n CameraList cameragui/*
cameragui/gpcamera.cpp:295:    CameraList *clist;
cameragui/gpcamera.cpp:337:    CameraList *clist;
cameragui/gpcamera.cpp:382:    CameraList *clist;
cameragui/gpcamera.cpp:852:    CameraList camList;
                               ^^^^^^^^^^^^^^^^^^  that's a DO NOT DO THIS

Last but not least:

$ grep -n clist- cameragui/* | echo good
good

;)

Achim



More information about the Digikam-devel mailing list