savannah-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Savannah-hackers] Regarding GNU coding standards


From: Nic Ferrier
Subject: [Savannah-hackers] Regarding GNU coding standards
Date: Sun, 01 Jul 2001 03:03:14 +0100

I'm not sure who the correct person to talk to about this is...

I think it would be good to update the advice given in the GNU coding
standard for Changelog entries so that overloading is specifically
covered.

The Changelog advice states that the name of a changed, removed or
added function (or method) should always be given.

But in object oriented languages like C++ or java there is a possible
ambiguity with just using the name.

For example, I've just added the following methods to a java class in
GCJ:

  void write(int c);
  void write(byte[] buffer,int start,int length);
  int read();
  int read(byte[] buffer,int start,int length);

How am I to refer to the 2 different versions of methods with the
same name?

I have solved the problem by using the java convention for talking
about overloaded names. Here's my Changelog entry:

>>>>
2001-06-28  Nic Ferrier <address@hidden>

* natPlainSocketImpl.cc: added IO control for the socket. 
The IO methods all use select() to implement socket timeouts 
which cause the java.io.InterruptedIOException to be raised.

(close): new function to close the socket

(write(jint)): new function to perform writes to the socket

(write(jbyteArray,jint,jint)): new function to perform block 
writes to the socket

(read()): new function to read a byte from the socket

(read(jbyteArray,jint,jint)): new function to read blocks 
of bytes from the socket


* PlainSocketImpl.java: added native methods and input 
and output stream handling (with inner stream classes)

(write(int)): new method binds the native function

(write(byte[],int,int)): new method binds the native function

(read()): new method binds the native function

(read(byte[],int,int)): new method binds the native function

(getInputStream): return an internal input stream class which 
calls the internal read methods

(getOutputStream): return an internal output stream class which
calls the internal write methods
<<<<

Of course, it doesn't have all those blank lines. They're just for
readability, but you get my point.

The trouble with this convention is you can't do an automatic search
without having the search program understand the syntax of these
entries.


If someone can just pass this on to whoever maintains the standard
I'd be grateful, or if someone can recommend someone to notify about
this I'd be happy to notify them.


Nic



reply via email to

[Prev in Thread] Current Thread [Next in Thread]