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 792946 - Actually use enums as enums
Actually use enums as enums
Status: RESOLVED OBSOLETE
Product: vte
Classification: Core
Component: general
git master
Other Mac OS
: Normal normal
: ---
Assigned To: VTE Maintainers
VTE Maintainers
[fixed:vteparser]
Depends on:
Blocks: vteparser
 
 
Reported: 2018-01-27 04:40 UTC by Evan Klitzke
Modified: 2018-04-09 09:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
small diff to use enums properly (1.13 KB, patch)
2018-01-27 04:40 UTC, Evan Klitzke
none Details | Review

Description Evan Klitzke 2018-01-27 04:40:33 UTC
Created attachment 367501 [details] [review]
small diff to use enums properly

Just a drive-by code cleanup, this doesn't actually fix anything. Applied against master.

I was looking through this file for another reason (I wanted to locally patch VTE to disable mouse tracking), and ran into this code. The reasoning for using an int doesn't make any sense to me -- these fields don't have non-enum values assigned to them, and I don't see any argument for using ints for alignment, (particularly given that this is C++ now). It looks like the "we need to guarantee its type" stuff was originally added by Nalin in commit e05ee559ce99030e3543eafe17bb86c81827adfb back in 2002, and then was copy/pasted around after that.
Comment 1 Christian Persch 2018-01-28 21:59:33 UTC
Yes, this isn't really necessary; we access this variable through int*, but sizeof(MouseTrackingMode)==sizeof(int) here.

You'll be happy to hear this code is going away soon, so I'd rather not introduce a merge conflict now.