Bug 48544

Summary: replace bitfields with flags or separate booleans as appropriate
Product: Telepathy Reporter: Simon McVittie <smcv>
Component: tp-glibAssignee: Telepathy bugs list <telepathy-bugs>
Status: RESOLVED MOVED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: normal    
Priority: medium    
Version: git master   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

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.