dxx-rebirth/common/include
Kp 073f00974a Eliminate uses of the typedef struct X { ... } X; pattern
C++ does not require this pattern.

import re, fileinput
to = re.compile(r'^typedef struct ([a-z_A-Z]+)\s*{')
tc = re.compile(r'^}(.*?)\s*([a-z_A-Z]+);$')
osn = None
for line in fileinput.input(inplace=True):
	m = to.match(line)
	if m:
		osn = m.group(1)
		print 'struct %s\n{' % osn
		continue
	if osn:
		m = tc.match(line)
		if m:
			csn = m.group(2)
			if osn == csn:
				print '}%s;' % m.group(1)
				osn = None
				continue
			else:
				osn = None
	print line,
2013-12-28 22:48:07 +00:00
..
editor Eliminate uses of the typedef struct X { ... } X; pattern 2013-12-28 22:48:07 +00:00
3d.h Eliminate uses of the typedef struct X { ... } X; pattern 2013-12-28 22:48:07 +00:00
args.h Eliminate uses of the typedef struct X { ... } X; pattern 2013-12-28 22:48:07 +00:00
byteswap.h Tighten SWAPINT 2013-12-28 22:37:00 +00:00
compiler-array.h Split compiler.h for PCH compatibility 2013-12-21 05:12:38 +00:00
compiler-lengthof.h Split compiler.h for PCH compatibility 2013-12-21 05:12:38 +00:00
compiler-range_for.h Split compiler.h for PCH compatibility 2013-12-21 05:12:38 +00:00
compiler-static_assert.h Split compiler.h for PCH compatibility 2013-12-21 05:12:38 +00:00
compiler-type_traits.h Split compiler.h for PCH compatibility 2013-12-21 05:12:38 +00:00
console.h Eliminate uses of the typedef struct X { ... } X; pattern 2013-12-28 22:48:07 +00:00
countarray.h Convert fvi to use countarray for segment list 2013-12-22 20:56:53 +00:00
digi_audio.h Switch to C++ linkage 2013-12-06 03:35:32 +00:00
digi_mixer.h Switch to C++ linkage 2013-12-06 03:35:32 +00:00
digi_mixer_music.h Switch to C++ linkage 2013-12-06 03:35:32 +00:00
dxxerror.h Use Error_puts instead of Error where possible 2013-12-17 04:03:34 +00:00
event.h Eliminate uses of the typedef struct X { ... } X; pattern 2013-12-28 22:48:07 +00:00
fmtcheck.h Rename con_puts length template 2013-12-22 20:12:41 +00:00
func.h Switch to C++ linkage 2013-12-06 03:35:32 +00:00
gr.h Eliminate uses of the typedef struct X { ... } X; pattern 2013-12-28 22:48:07 +00:00
grdef.h Remove duplicate declarations 2013-10-03 03:11:52 +00:00
hash.h Eliminate uses of the typedef struct X { ... } X; pattern 2013-12-28 22:48:07 +00:00
hmp.h Eliminate uses of the typedef struct X { ... } X; pattern 2013-12-28 22:48:07 +00:00
iff.h Add typedef palette_array_t for palette data 2013-12-22 00:05:13 +00:00
ignorecase.h Switch to C++ linkage 2013-12-06 03:35:32 +00:00
internal.h Use array for palette_array_t 2013-12-22 00:37:36 +00:00
interp.h Eliminate uses of the typedef struct X { ... } X; pattern 2013-12-28 22:48:07 +00:00
joy.h Switch to C++ linkage 2013-12-06 03:35:32 +00:00
jukebox.h Compact known file extension storage 2013-12-13 03:58:01 +00:00
key.h Eliminate uses of the typedef struct X { ... } X; pattern 2013-12-28 22:48:07 +00:00
loadgl.h Mark OpenGL loader functions static 2013-10-29 03:24:42 +00:00
makesig.h
maths.h Switch to C++ linkage 2013-12-06 03:35:32 +00:00
messagebox.h Switch to C++ linkage 2013-12-06 03:35:32 +00:00
mouse.h Switch to C++ linkage 2013-12-06 03:35:32 +00:00
ogl_init.h Eliminate uses of the typedef struct X { ... } X; pattern 2013-12-28 22:48:07 +00:00
palette.h Use array for palette_array_t 2013-12-22 00:37:36 +00:00
pcx.h Use array for palette_array_t 2013-12-22 00:37:36 +00:00
physfsx.h Match PHYSFSX_readSXE?? return types to the internal type 2013-12-28 22:03:50 +00:00
pstypes.h Fix level load hang on >=mingw32-gcc-4.7 2013-08-25 17:16:41 +00:00
rbaudio.h Eliminate uses of the typedef struct X { ... } X; pattern 2013-12-28 22:48:07 +00:00
rle.h Switch to C++ linkage 2013-12-06 03:35:32 +00:00
strutil.h Annotate mem_malloc/mem_calloc as __attribute__((malloc)) 2013-12-20 03:24:39 +00:00
texmap.h Eliminate uses of the typedef struct X { ... } X; pattern 2013-12-28 22:48:07 +00:00
timer.h Switch to C++ linkage 2013-12-06 03:35:32 +00:00
u_mem.h Annotate mem_malloc/calloc/realloc as __attribute__((alloc_size)) 2013-12-20 03:33:32 +00:00
ui.h Eliminate uses of the typedef struct X { ... } X; pattern 2013-12-28 22:48:07 +00:00
varutil.h Split compiler.h for PCH compatibility 2013-12-21 05:12:38 +00:00
vecmat.h Eliminate uses of the typedef struct X { ... } X; pattern 2013-12-28 22:48:07 +00:00
window.h Eliminate uses of the typedef struct X { ... } X; pattern 2013-12-28 22:48:07 +00:00