[Freeciv-Dev] Re: (PR#3579) When stdarg.h should be included?
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Sat, Mar 29, 2003 at 05:46:56AM -0800, Raimar Falke wrote:
> On Sat, Mar 29, 2003 at 03:22:20AM -0800, Raimar Falke wrote:
> > I have however fixed another problem which was also mentioned: the
> > random including of system header files. The attached patch fixes
> > this. I will apply it in 24h.
>
> Attached is a patch for the non-system header files. I wrote a script
> which checks these. A group is a list of includes which are seperated
> by a newline. The script checks for:
> - correct order in each group (one for common, one for client/include
> and so on)
> - correct ordering of the groups (the order is common, client, server
> and then ai, alphabetically inside these, so that client/agents is in
> front of client/include)
> - no double groups (no two common groups)
> - the last group for a .c file is the corresponding .h file
> (EXCEPTION: spec* includes)
Attached is a patch for the recently applied include order rules. The
remaining problem which my script doesn't like are (note from me with
#):
client/gui-gtk/gamedlgs.c
last group contains more than one include
wrong file included as last include
# there is no gamedlgs.h
client/gui-gtk/graphics.c
wrong order of groups
duplicate groups
is = [1, 2, 3, 4, 5, 5, 6]
should = [1, 2, 3, 4, 5, 6]
# cursor includes
client/gui-gtk/resources.c
wrong file included as last include
# includes Freeciv.h
common/packets.h
duplicate groups
is = [4, 4]
should = [4]
# includes packets_lsend.h
common/packets_lsend.c
wrong file included as last include
# includes packets.h
common/shared.c
wrong order of groups
duplicate groups
is = [1, 2, 3, 3, 4]
should = [1, 2, 3, 4]
# macos band-aid
common/support.c
wrong order
include <events.h> include <events.h>
include <fcntl.h> include <fcntl.h>
include <sys/ioctl.h> <-> include <process.h>
include <sys/select.h> <-> include <sys/ioctl.h>
include <sys/time.h> <-> include <sys/select.h>
include <sys/types.h> <-> include <sys/time.h>
include <unistd.h> <-> include <sys/types.h>
include <process.h> <-> include <unistd.h>
include <windows.h> include <windows.h>
include <winsock.h> include <winsock.h>
# the following would have to be splitted
#ifdef WIN32_NATIVE
#include <process.h>
#include <windows.h>
#endif
I will commit this patch in the next days.
Raimar
--
email: rf13@xxxxxxxxxxxxxxxxx
"At the beginning of the week, we sealed ten BSD programmers
into a computer room with a single distribution of BSD Unix.
Upon opening the room after seven days, we found all ten programmers
dead, clutching each other's throats, and thirteen new flavors of BSD."
sort_includes1.diff.gz
Description: sort_includes1.diff.gz
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] Re: (PR#3579) When stdarg.h should be included?,
Raimar Falke <=
|
|