[icedtea-web] Proposed formatting for C++ side of plugin
Omair Majid
omajid at redhat.com
Fri Dec 28 15:07:05 PST 2012
On 12/28/2012 05:16 PM, Adam Domurad wrote:
> Originally sent this off-list, sorry.
>
> On 12/27/2012 11:05 AM, Omair Majid wrote:
>> I didn't see a patch posted in the email thread, but I am willing to
>> look at one when it's posted.
>>
>> Omair
>>
> Okay, lets give it a try then. Overall I was a little disappointed with
> the customization that the formatting options allowed.
>
> Formatting used was essentially standard K&R format that comes with
> Eclipse, except:
> - spaces only (no tabs)
> - 100-width line wraps, this is a debatable choice but the result
> felt truer to what was there before
>
> Options played around with:
> - Do not attempt to join wrapped lines -- would allow for keeping
> some of the manually formatted code, but has unpleasant side effects. It
> may be worthy to turn on 'do not attempt to join wrapped lines' once the
> autoformating has taken place, however note that it would not join any
> lines so it would not eg enforce K&R brace style effectively.
>
> I'll post the formatting profile once it's been finalized.
>
> Just posting HEAD formatted for now pending feedback (Have fun reading
> the diff!).
On a quick look, one thing jumps out at me:
-bool
-JavaRequestProcessor::newMessageOnBus(const char* message)
-{
+bool JavaRequestProcessor::newMessageOnBus(const char* message) {
The K&R indentation style places the opening brace in the line below the
function prototype:
+bool JavaRequestProcessor::newMessageOnBus(const char* message)
+{
Also, this patch may need some manual tweaks. Some if statements with
comments on the conditional have the opening brace on the next line
rather than on the same line:
+ } else if (!message_parts->at(4)->find("GetStringChars"))
// GetStringChars (UTF-16LE/UCS-2)
+ {
I will take a more detailed look at this soon.
Cheers,
Omair
--
PGP Key: 66484681 (http://pgp.mit.edu/)
Fingerprint = F072 555B 0A17 3957 4E95 0056 F286 F14F 6648 4681
More information about the distro-pkg-dev
mailing list