Bug 1483

Summary: Decline C++ style pointer notation
Product: UIM Reporter: YamaKen <yamaken>
Component: libuimAssignee: uim-bugs
Status: RESOLVED FIXED QA Contact:
Severity: trivial    
Priority: low    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 7164    

Description YamaKen 2004-09-27 15:10:01 UTC
We should decline C++ style pointer notation such as 'char*' or 'void*'. Almost
have been rewritten, but gtk-related codes are left untouched since I don't know
coding style of GTK+ well.

In r1326, they have been replaced with traditional 'char *' or
'void *'. Even if it does not cause compile error, I think that such
coding style is a bad habit that leads a human error due to
misinterpretation about type declaration.

For example, a declaration 'char* a, b, c;' may sometimes be
interpreted as 'char* a; char* b; char* c;' by less-experienced
C/C++ programmers. But it of course results 'char* a; char b; char c;'.

So we should write pointers as 'char *' style. 'char *a, b, c;' will
not cause such misinterpretation. We should remind that the uim
library will be used by wide-range of programmers. We should
eliminate any source of human errors.

Since I don't know the coding style of GTK+ well, gtk-related codes
have been left untouched about such pointer notations. We should
also rewrite them if no recommendation about C++ style pointer
notation exists for GTK+.
Comment 1 TOKUNAGA Hiroyuki 2004-11-03 10:19:19 UTC
I checked gtk-im-uim.c and uim-candwin-gtk.c and fixed 1 'gchar*' style
definition. (See rev1569)
Now I think all C++ style pointer notation is fixed in Gtk+ related code.
Could I close this bug?
Comment 2 YamaKen 2004-11-03 11:01:45 UTC
Not yet. I've checked it by following command.

$ find . \( -name '*.c' -or -name '*.cpp' -or -name '*.h' \) -exec egrep -H
'[_a-zA-Z0-9]\*\b' {} \;
Comment 3 YamaKen 2004-11-03 11:03:47 UTC
Oops, the previous command is wrong.

$ find . \( -name '*.c' -or -name '*.cpp' -or -name '*.h' \) -exec egrep -H
'[_a-zA-Z0-9]\*' {} \;
Comment 4 TOKUNAGA Hiroyuki 2004-11-03 11:27:48 UTC
I'm not edit .cpp files, but I fixed all C++ style pointer notations from .c files.
Comment 5 YamaKen 2004-11-03 12:16:33 UTC
Slow down and check double. There are many C++ style notations.
Comment 6 YamaKen 2007-07-22 09:48:24 UTC
Finished in r4780.

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.