After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 732413 - *_CLASS macro name does not take lower_case_cprefix into account
*_CLASS macro name does not take lower_case_cprefix into account
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Code Generator: GObject
unspecified
Other Linux
: Normal major
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2014-06-29 06:52 UTC by Evan Nemerson
Modified: 2014-07-01 23:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
codegen: cast instead of trying to guess *_CLASS macro name (2.56 KB, patch)
2014-06-29 07:28 UTC, Evan Nemerson
none Details | Review

Description Evan Nemerson 2014-06-29 06:52:30 UTC
https://bugzilla.gnome.org/show_bug.cgi?id=723910#c32

I think we should just abandon trying to call the macro and just cast to the FooClass* pointer ourselves.  Pretty generated C is a lost cause, and the type name is more reliable.

That said, if we really want to keep using the macro we should probably use lower_case_cprefix.ascii_up().
Comment 1 Evan Nemerson 2014-06-29 07:28:42 UTC
Created attachment 279517 [details] [review]
codegen: cast instead of trying to guess *_CLASS macro name

Should probably run this through staging first, but I think it's right.
Comment 2 Luca Bruno 2014-06-29 09:15:42 UTC
Ok for me as long as it passes staging.
Comment 3 Stefan Ringel 2014-06-30 07:18:56 UTC
works, but I have warnings.

src/rtsp/MediaFactory.c:489:55: Warnung: Zuweisung von inkompatiblem Zeigertyp
  ((GstRTSPMediaFactoryClass *) klass)->create_element = dvb_media_factory_real_create_element;
                                                       ^
src/rtsp/MediaFactory.c:490:56: Warnung: Zuweisung von inkompatiblem Zeigertyp
  ((GstRTSPMediaFactoryClass *) klass)->create_pipeline = dvb_media_factory_real_create_pipeline;
Comment 4 Evan Nemerson 2014-06-30 07:20:36 UTC
The warnings are unrelated to this bug.  They are caused by the parameter being generated as GstPipeline* instead of GstElement*.
Comment 5 Stefan Ringel 2014-07-01 16:55:42 UTC
any chance to go into master git?
Comment 6 Evan Nemerson 2014-07-01 23:42:59 UTC
commit 49beca7a8b8e7a0f3988eb987baeb64021cdeae4
Author: Evan Nemerson <evan@nemerson.com>
Date:   Sun Jun 29 00:26:39 2014 -0700

    codegen: cast instead of trying to guess *_CLASS macro name
    
    Fixes bug 732413