Commit graph

13 commits

Author SHA1 Message Date
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
Kp 21cc89e2c8 Use ui_dputs_at instead of ui_dprintf_at where possible 2013-12-17 04:03:34 +00:00
Kp be041a9cfc Add type checking for ui_create_dialog 2013-12-17 03:49:24 +00:00
Kp d1fa9ff7a6 Simplify setup for ui_messagebox_n 2013-12-15 21:54:59 +00:00
Kp 9de54cfa74 Switch to C++ linkage
import fileinput
guard = 0
cxxguard = '#ifdef __cplusplus\n'
for line in fileinput.input(inplace=True):
	if line == cxxguard:
		guard = 1
		continue
	if guard:
		if line == 'extern "C" {\n':
			guard = 2
			continue
		if line == '}\n':
			guard = 0
			continue
		if guard == 2:
			assert(line == '#endif\n')
			guard = 0
			print cxxguard,
			continue
	print line,
2013-12-06 03:35:32 +00:00
Kp 8ed99faf5c Make headers freestanding 2013-10-26 03:50:28 +00:00
Kp aa9127e3c1 Enable -Wwrite-strings 2013-09-15 21:34:03 +00:00
Kp a01dbc59d6 Make ui_messagebox_n static 2013-08-09 01:56:34 +00:00
Kp 000774f49d Move common/ui/button.c -> common/ui/button.cpp 2013-08-04 17:57:20 +00:00
Kp ff90315978 Use SConscript configure support to probe for format(printf) attribute 2013-07-27 22:17:13 +00:00
Kp dc84c7967f Remove use of enum forward declaration
It is valid C99, but not valid C++03.
2013-07-21 21:40:46 +00:00
Kp a1ba420031 Mark various parameters and variables as const 2013-07-20 23:12:24 +00:00
Kp 501f1d6a25 Move */include/ui.h -> common/include/ui.h 2013-03-03 01:03:33 +00:00
Renamed from d2x-rebirth/include/ui.h (Browse further)