Bug 48544 - replace bitfields with flags or separate booleans as appropriate
Summary: replace bitfields with flags or separate booleans as appropriate
Status: RESOLVED MOVED
Alias: None
Product: Telepathy
Classification: Unclassified
Component: tp-glib (show other bugs)
Version: git master
Hardware: Other All
: medium normal
Assignee: Telepathy bugs list
QA Contact: Telepathy bugs list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-11 03:41 UTC by Simon McVittie
Modified: 2019-12-03 20:39 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Simon McVittie 2012-04-11 03:41:54 UTC
This:

> > +  unsigned had_weak_object:1;

is pretty ugly.

Where booleans make most sense, we should use "gboolean had_weak_object;" and just accept the extra memory. We don't necessarily even need to wait for next; we can do this in master.

I suspect that in at least some cases we'd be better off with an explicit flags word, though:

    http://blog.ometer.com/2011/01/20/boolean-parameters-are-wrong/

(in which case we might be changing the API; if so, that's a reason to make the change in next).
Comment 1 Jonny Lamb 2012-04-11 09:11:07 UTC
(In reply to comment #0)
> This:
> 
> > > +  unsigned had_weak_object:1;
> 
> is pretty ugly.
> 
> Where booleans make most sense, we should use "gboolean had_weak_object;" and
> just accept the extra memory. We don't necessarily even need to wait for next;
> we can do this in master.

Yes yes yes!
Comment 2 GitLab Migration User 2019-12-03 20:39:41 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/telepathy/telepathy-glib/issues/86.


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.