Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 395817 | Differences between
and this patch

Collapse All | Expand All

(-)file_not_specified_in_diff (-57 / +58 lines)
Line  Link Here
0
-- src/binheader_writef_check.py
0
++ src/binheader_writef_check.py
Lines 48-66 Link Here
48
def find_format_string (s):
48
def find_format_string (s):
49
	fmt = re.search ('"([^"]+)"', s)
49
	fmt = re.search ('"([^"]+)"', s)
50
	if not fmt:
50
	if not fmt:
51
		print "Bad format in :\n\n\t%s\n\n" % s
51
		print("Bad format in :\n\n\t%s\n\n" % s)
52
		sys.exit (1)
52
		sys.exit (1)
53
	fmt = fmt.groups ()
53
	fmt = fmt.groups ()
54
	if len (fmt) != 1:
54
	if len (fmt) != 1:
55
		print "Bad format in :\n\n\t%s\n\n" % s
55
		print("Bad format in :\n\n\t%s\n\n" % s)
56
		sys.exit (1)
56
		sys.exit (1)
57
	return _whitespace_re.sub ("", fmt [0])
57
	return _whitespace_re.sub ("", fmt [0])
58
58
59
def get_param_list (data):
59
def get_param_list (data):
60
	dlist = re.search ("\((.+)\)\s*;", data)
60
	dlist = re.search ("\((.+)\)\s*;", data)
61
	dlist = dlist.groups ()[0]
61
	dlist = dlist.groups ()[0]
62
	dlist = string.split (dlist, ",")
62
	dlist = dlist.split(",")
63
	dlist = [string.strip (x) for x in dlist]
63
	dlist = [x.strip() for x in dlist]
64
	return dlist [2:]
64
	return dlist [2:]
65
65
66
def handle_file (fname):
66
def handle_file (fname):
Lines 88-100 Link Here
88
			# print item
88
			# print item
89
			# print "    param [%d] %c : %s <-> %s" % (param_index, ch, params [param_index], params [param_index + 1])
89
			# print "    param [%d] %c : %s <-> %s" % (param_index, ch, params [param_index], params [param_index + 1])
90
90
91
			if string.find (params [param_index + 1], "sizeof") < 0 \
91
			print(params[param_index + 1])
92
						and string.find (params [param_index + 1], "make_size_t") < 0 \
92
			if params[param_index + 1].find("sizeof") < 0 \
93
						and string.find (params [param_index + 1], "strlen") < 0:
93
						and params[param_index + 1].find("make_size_t") < 0 \
94
				if errors == 0: print
94
						and params[param_index + 1].find("strlen") < 0:
95
				print "\n%s :" % fname
95
				if errors == 0: sys.stdout.write("\n")
96
				print "    param [%d] %c : %s <-> %s" % (param_index, ch, params [param_index], params [param_index + 1])
96
				print("\n%s :" % fname)
97
				print "    %s" % item
97
				print("    param [%d] %c : %s <-> %s" % (param_index, ch, params [param_index], params [param_index + 1]))
98
				print("    %s" % item)
98
				errors += 1
99
				errors += 1
99
			param_index += 2
100
			param_index += 2
100
101
Lines 103-116 Link Here
103
#===============================================================================
104
#===============================================================================
104
105
105
if len (sys.argv) > 1:
106
if len (sys.argv) > 1:
106
	print "\n    binheader_writef_check                   :",
107
	sys.stdout.write("\n    binheader_writef_check                   :")
107
	sys.stdout.flush ()
108
	sys.stdout.flush ()
108
	errors = 0
109
	errors = 0
109
	for fname in sys.argv [1:]:
110
	for fname in sys.argv [1:]:
110
		errors += handle_file (fname)
111
		errors += handle_file (fname)
111
	if errors > 0:
112
	if errors > 0:
112
		print "\nErrors : %d\n" % errors
113
		print("\nErrors : %d\n" % errors)
113
		sys.exit (1)
114
		sys.exit (1)
114
115
115
print "ok\n"
116
print("ok\n")
116
117
117
-- src/create_symbols_file.py
118
++ src/create_symbols_file.py
Lines 79-139 Link Here
79
#-------------------------------------------------------------------------------
79
#-------------------------------------------------------------------------------
80
80
81
def linux_symbols (progname, version):
81
def linux_symbols (progname, version):
82
	print "# Auto-generated by %s\n" %progname
82
	print("# Auto-generated by %s\n" %progname)
83
	print "libsndfile.so.%s" % version
83
	print("libsndfile.so.%s" % version)
84
	print "{"
84
	print("{")
85
	print "  global:"
85
	print("  global:")
86
	for name, ordinal in ALL_SYMBOLS:
86
	for name, ordinal in ALL_SYMBOLS:
87
		if  name == "sf_wchar_open":
87
		if  name == "sf_wchar_open":
88
			continue
88
			continue
89
		print "    %s ;" % name
89
		print("    %s ;" % name)
90
	print "  local:"
90
	print("  local:")
91
	print "    * ;"
91
	print("    * ;")
92
	print "} ;"
92
	print("} ;")
93
	print
93
	sys.stdout.write("\n")
94
	return
94
	return
95
95
96
def darwin_symbols (progname, version):
96
def darwin_symbols (progname, version):
97
	print "# Auto-generated by %s\n" %progname
97
	print("# Auto-generated by %s\n" %progname)
98
	for name, ordinal in ALL_SYMBOLS:
98
	for name, ordinal in ALL_SYMBOLS:
99
		if  name == "sf_wchar_open":
99
		if  name == "sf_wchar_open":
100
			continue
100
			continue
101
		print "_%s" % name
101
		print("_%s" % name)
102
	print
102
	sys.stdout.write("\n")
103
	return
103
	return
104
104
105
def win32_symbols (progname, version, name):
105
def win32_symbols (progname, version, name):
106
	print "; Auto-generated by %s\n" %progname
106
	print("; Auto-generated by %s\n" %progname)
107
	print "LIBRARY %s-%s.dll" % (name, re.sub ("\..*", "", version))
107
	print("LIBRARY %s-%s.dll" % (name, re.sub ("\..*", "", version)))
108
	print "EXPORTS\n"
108
	print("EXPORTS\n")
109
	for name, ordinal in ALL_SYMBOLS:
109
	for name, ordinal in ALL_SYMBOLS:
110
		print "%-20s @%s" % (name, ordinal)
110
		print("%-20s @%s" % (name, ordinal))
111
	print
111
	sys.stdout.write("\n")
112
	return
112
	return
113
113
114
def os2_symbols (progname, version, name):
114
def os2_symbols (progname, version, name):
115
	print "; Auto-generated by %s\n" %progname
115
	print("; Auto-generated by %s\n" %progname)
116
	print "LIBRARY %s%s" % (name, re.sub ("\..*", "", version))
116
	print("LIBRARY %s%s" % (name, re.sub ("\..*", "", version)))
117
	print "INITINSTANCE TERMINSTANCE"
117
	print("INITINSTANCE TERMINSTANCE")
118
	print "CODE PRELOAD MOVEABLE DISCARDABLE"
118
	print("CODE PRELOAD MOVEABLE DISCARDABLE")
119
	print "DATA PRELOAD MOVEABLE MULTIPLE NONSHARED"
119
	print("DATA PRELOAD MOVEABLE MULTIPLE NONSHARED")
120
	print "EXPORTS\n"
120
	print("EXPORTS\n")
121
	for name, ordinal in ALL_SYMBOLS:
121
	for name, ordinal in ALL_SYMBOLS:
122
		if  name == "sf_wchar_open":
122
		if  name == "sf_wchar_open":
123
			continue
123
			continue
124
		print "_%-20s @%s" % (name, ordinal)
124
		print("_%-20s @%s" % (name, ordinal))
125
	print
125
	sys.stdout.write("\n")
126
	return
126
	return
127
127
128
def plain_symbols (progname, version, name):
128
def plain_symbols (progname, version, name):
129
	for name, ordinal in ALL_SYMBOLS:
129
	for name, ordinal in ALL_SYMBOLS:
130
		print name
130
		print(name)
131
131
132
def no_symbols (os_name):
132
def no_symbols (os_name):
133
	print
133
	sys.stdout.write("\n")
134
	print "No known way of restricting exported symbols on '%s'." % os_name
134
	print("No known way of restricting exported symbols on '%s'." % os_name)
135
	print "If you know a way, please contact the author."
135
	print("If you know a way, please contact the author.")
136
	print
136
	sys.stdout.write("\n")
137
	return
137
	return
138
138
139
#-------------------------------------------------------------------------------
139
#-------------------------------------------------------------------------------
Lines 141-157 Link Here
141
progname = re.sub (".*[\\/]", "", sys.argv [0])
141
progname = re.sub (".*[\\/]", "", sys.argv [0])
142
142
143
if len (sys.argv) != 3:
143
if len (sys.argv) != 3:
144
	print
144
	sys.stdout.write("\n")
145
	print "Usage : %s <target OS name> <libsndfile version>." % progname
145
	print("Usage : %s <target OS name> <libsndfile version>." % progname)
146
	print
146
	sys.stdout.write("\n")
147
	print "    Currently supported values for target OS are:"
147
	print("    Currently supported values for target OS are:")
148
	print "          linux"
148
	print("          linux")
149
	print "          darwin     (ie MacOSX)"
149
	print("          darwin     (ie MacOSX)")
150
	print "          win32      (ie wintendo)"
150
	print("          win32      (ie wintendo)")
151
	print "          cygwin     (Cygwin on wintendo)"
151
	print("          cygwin     (Cygwin on wintendo)")
152
	print "          os2        (OS/2)"
152
	print("          os2        (OS/2)")
153
	print "          plain      (plain list of symbols)"
153
	print("          plain      (plain list of symbols)")
154
	print
154
	sys.stdout.write("\n")
155
	sys.exit (1)
155
	sys.exit (1)
156
156
157
os_name = sys.argv [1]
157
os_name = sys.argv [1]

Return to bug 395817