[Webkit-unassigned] [Bug 27511] Add WinCE specific platform/graphics files to WebCore
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Sun Aug 9 17:48:56 PDT 2009
https://bugs.webkit.org/show_bug.cgi?id=27511
--- Comment #65 from Peter Kasting <pkasting at google.com> 2009-08-09 17:48:55 PDT ---
(In reply to comment #64)
> Making code too much
> readable just makes me feel that I'm not doing C++, or I'm doing C++ in MS
> style :) I may be sick at the point. But still, too many restrictions and
> requirements on such things make programming no more interesting, because one
> tries to write code as he was another person, tries to follow another person's
> mind. Although he can still do it, but there's no fun.
I don't really know what to say. In general style guides aren't designed
around what you find fun. But like I said, there's no WebKit style rule on
this one. I was giving my personal opinion.
If there was a style rule, and you said it wasn't very fun, I don't think it'd
earn much sympathy...
> Sigh. I don't know why "while(true)" is more common.
Probably because "while" was designed for the case when you don't need a loop
initializer or increment.
> It should be struct in this case, because it's used by libjpeg, like a C
> struct.
I don't have the contents of libjpeg.h in front of me so it's hard for me to
say exactly how something is used, but it looks to me like this struct is
entirely your own, set up in compressBitmapToJpeg() and then read in the
various helper functions you define. And I can't see how the libjpeg sources
could make use of a type defined in your code rather than theirs. From context
here it looks like they let you stick some user data on the
jpeg_compress_struct they define. In that case, you should define the struct
in a way that matches WebKit style.
> "pub" acts as the base class of jpeg_dest_mgr. Another idea is:
>
> struct JpegDestinationManager: jpeg_destination_mgr
> {
> };
>
> What do you think?
I think that is not good practice if the libjpeg C code expects to access a
jpeg_destination_mgr struct at offset 0 in this object. It probably works, but
passing C++ classes with inheritance into C code to use makes me uneasy.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list