GNOME Bugzilla – Bug 792946
Actually use enums as enums
Last modified: 2018-04-09 09:00:20 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.
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.