Skip to content

Commit c5b52ab

Browse files
committed
clang-format all source files
All files were formatted with the command at repository root: `find ./ -iname *.h -o -iname *.cpp | xargs clang-format -i` .clang-format contents: --- Language: Cpp BasedOnStyle: Google ColumnLimit: 88 IndentWidth: 4 AccessModifierOffset: -4 SortIncludes: true ConstructorInitializerIndentWidth: 8 ContinuationIndentWidth: 8 DerivePointerAlignment: false MaxEmptyLinesToKeep: 2 ... To help with automerging, you will need to run this same command with the same formatting rules on your own branch. Then commit those changes, and then finally merged
1 parent 3f3b2dd commit c5b52ab

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+11843
-12083
lines changed

.clang-format

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
Language: Cpp
3+
BasedOnStyle: Google
4+
ColumnLimit: 88
5+
IndentWidth: 4
6+
AccessModifierOffset: -4
7+
SortIncludes: true
8+
ConstructorInitializerIndentWidth: 8
9+
ContinuationIndentWidth: 8
10+
DerivePointerAlignment: false
11+
MaxEmptyLinesToKeep: 2
12+
...

src/asar-dll-bindings/c/asardll.h

Lines changed: 101 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -1,131 +1,133 @@
11
// note for asar devs: autogenerated by update_c_bind.py, don't edit this
22
// directly! either edit asardll.h.in or interface-lib.cpp.
33
#ifndef ASAR_DLL_H_INCLUDED
4-
# define ASAR_DLL_H_INCLUDED
4+
#define ASAR_DLL_H_INCLUDED
55

66
#define expectedapiversion 400
77

88
#include <stdbool.h>
9-
#include <stddef.h> // for size_t
9+
#include <stddef.h> // for size_t
1010

1111
// These structures are returned from various functions
1212
struct stackentry {
13-
const char * fullpath;
14-
const char * prettypath;
15-
int lineno;
16-
const char * details;
13+
const char* fullpath;
14+
const char* prettypath;
15+
int lineno;
16+
const char* details;
1717
};
1818

1919
struct errordata {
20-
const char * fullerrdata;
21-
const char * rawerrdata;
22-
const char * block;
23-
const char * filename;
24-
int line;
25-
const struct stackentry * callstack;
26-
int callstacksize;
27-
const char * errname;
20+
const char* fullerrdata;
21+
const char* rawerrdata;
22+
const char* block;
23+
const char* filename;
24+
int line;
25+
const struct stackentry* callstack;
26+
int callstacksize;
27+
const char* errname;
2828
};
2929

3030
struct labeldata {
31-
const char * name;
32-
int location;
31+
const char* name;
32+
int location;
3333
};
3434

3535
struct definedata {
36-
const char * name;
37-
const char * contents;
36+
const char* name;
37+
const char* contents;
3838
};
3939

4040
struct warnsetting {
41-
const char * warnid;
42-
bool enabled;
41+
const char* warnid;
42+
bool enabled;
4343
};
4444

4545
struct memoryfile {
46-
const char* path;
47-
const void* buffer;
48-
size_t length;
46+
const char* path;
47+
const void* buffer;
48+
size_t length;
4949
};
5050

5151
enum mappertype {
52-
invalid_mapper,
53-
lorom,
54-
hirom,
55-
sa1rom,
56-
bigsa1rom,
57-
sfxrom,
58-
exlorom,
59-
exhirom,
60-
norom
52+
invalid_mapper,
53+
lorom,
54+
hirom,
55+
sa1rom,
56+
bigsa1rom,
57+
sfxrom,
58+
exlorom,
59+
exhirom,
60+
norom
6161
};
6262

6363
struct writtenblockdata {
64-
int pcoffset;
65-
int snesoffset;
66-
int numbytes;
64+
int pcoffset;
65+
int snesoffset;
66+
int numbytes;
6767
};
6868

6969
struct patchparams {
70-
// The size of this struct. Set to (int)sizeof(patchparams).
71-
int structsize;
72-
73-
// Same parameters as asar_patch()
74-
const char * patchloc;
75-
char * romdata;
76-
int buflen;
77-
int * romlen;
78-
79-
// Include paths to use when searching files.
80-
const char** includepaths;
81-
int numincludepaths;
82-
83-
// A list of additional defines to make available to the patch.
84-
const struct definedata* additional_defines;
85-
int additional_define_count;
86-
87-
// Path to a text file to parse standard include search paths from.
88-
// Set to NULL to not use any standard includes search paths.
89-
const char* stdincludesfile;
90-
91-
// Path to a text file to parse standard defines from.
92-
// Set to NULL to not use any standard defines.
93-
const char* stddefinesfile;
94-
95-
// A list of warnings to enable or disable.
96-
// Specify warnings in the format "WXXXX" where XXXX = warning ID.
97-
const struct warnsetting * warning_settings;
98-
int warning_setting_count;
99-
100-
// List of memory files to create on the virtual filesystem.
101-
const struct memoryfile * memory_files;
102-
int memory_file_count;
103-
104-
// Set override_checksum_gen to true and generate_checksum to true/false
105-
// to force generating/not generating a checksum.
106-
bool override_checksum_gen;
107-
bool generate_checksum;
108-
109-
// Set this to true for generated error and warning texts to always
110-
// contain their full call stack.
111-
bool full_call_stack;
70+
// The size of this struct. Set to (int)sizeof(patchparams).
71+
int structsize;
72+
73+
// Same parameters as asar_patch()
74+
const char* patchloc;
75+
char* romdata;
76+
int buflen;
77+
int* romlen;
78+
79+
// Include paths to use when searching files.
80+
const char** includepaths;
81+
int numincludepaths;
82+
83+
// A list of additional defines to make available to the patch.
84+
const struct definedata* additional_defines;
85+
int additional_define_count;
86+
87+
// Path to a text file to parse standard include search paths from.
88+
// Set to NULL to not use any standard includes search paths.
89+
const char* stdincludesfile;
90+
91+
// Path to a text file to parse standard defines from.
92+
// Set to NULL to not use any standard defines.
93+
const char* stddefinesfile;
94+
95+
// A list of warnings to enable or disable.
96+
// Specify warnings in the format "WXXXX" where XXXX = warning ID.
97+
const struct warnsetting* warning_settings;
98+
int warning_setting_count;
99+
100+
// List of memory files to create on the virtual filesystem.
101+
const struct memoryfile* memory_files;
102+
int memory_file_count;
103+
104+
// Set override_checksum_gen to true and generate_checksum to true/false
105+
// to force generating/not generating a checksum.
106+
bool override_checksum_gen;
107+
bool generate_checksum;
108+
109+
// Set this to true for generated error and warning texts to always
110+
// contain their full call stack.
111+
bool full_call_stack;
112112
};
113113

114114
#ifdef __cplusplus
115115
extern "C" {
116116
#endif
117117

118-
//Initializes Asar. Call this before doing anything.
119-
//If it returns false, something went wrong, and you may not use any other Asar functions. This is
120-
//either due to not finding the library, or not finding all expected functions in the library.
118+
// Initializes Asar. Call this before doing anything.
119+
// If it returns false, something went wrong, and you may not use any other Asar
120+
// functions. This is either due to not finding the library, or not finding all expected
121+
// functions in the library.
121122
bool asar_init(void);
122123

123-
// Same as above, but instead of automatically looking for and trying to load asar.dll, takes
124-
// a path to the Asar DLL and tries to load it.
125-
// The path is expected to be UTF-8-encoded, even on Windows.
126-
bool asar_init_with_dll_path(const char * dllpath);
124+
// Same as above, but instead of automatically looking for and trying to load asar.dll,
125+
// takes a path to the Asar DLL and tries to load it. The path is expected to be
126+
// UTF-8-encoded, even on Windows.
127+
bool asar_init_with_dll_path(const char* dllpath);
127128

128-
//Frees all of Asar's structures and unloads the module. Only asar_init may be called after calling
129+
// Frees all of Asar's structures and unloads the module. Only asar_init may be called
130+
// after calling
129131
// this; anything else will lead to segfaults.
130132
void asar_close(void);
131133

@@ -159,7 +161,7 @@ extern bool (*asar_reset)(void);
159161
* be left unchanged.
160162
* See the documentation of struct patchparams for more information.
161163
*/
162-
extern bool (*asar_patch)(const struct patchparams *params);
164+
extern bool (*asar_patch)(const struct patchparams* params);
163165

164166
/* Returns the maximum possible size of the output ROM from asar_patch().
165167
* Giving this size to buflen guarantees you will not get any buffer too small
@@ -173,59 +175,59 @@ extern int (*asar_maxromsize)(void);
173175
* called again, or until asar_patch, asar_reset or asar_close is called,
174176
* whichever comes first. Copy the contents if you need it for a longer time.
175177
*/
176-
extern const struct errordata * (*asar_geterrors)(int * count);
178+
extern const struct errordata* (*asar_geterrors)(int* count);
177179

178180
/* Get a list of all warnings.
179181
*/
180-
extern const struct errordata * (*asar_getwarnings)(int * count);
182+
extern const struct errordata* (*asar_getwarnings)(int* count);
181183

182184
/* Get a list of all printed data.
183185
*/
184-
extern const char * const * (*asar_getprints)(int * count);
186+
extern const char* const* (*asar_getprints)(int* count);
185187

186188
/* Get a list of all labels.
187189
*/
188-
extern const struct labeldata * (*asar_getalllabels)(int * count);
190+
extern const struct labeldata* (*asar_getalllabels)(int* count);
189191

190192
/* Get the ROM location of one label. -1 means "not found".
191193
*/
192-
extern int (*asar_getlabelval)(const char * name);
194+
extern int (*asar_getlabelval)(const char* name);
193195

194196
/* Get the value of a define.
195197
*/
196-
extern const char * (*asar_getdefine)(const char * name);
198+
extern const char* (*asar_getdefine)(const char* name);
197199

198200
/* Parses all defines in the parameter. Note that it may emit errors.
199201
*/
200-
extern const char * (*asar_resolvedefines)(const char * data);
202+
extern const char* (*asar_resolvedefines)(const char* data);
201203

202204
/* Gets the values and names of all defines.
203205
*/
204-
extern const struct definedata * (*asar_getalldefines)(int * count);
206+
extern const struct definedata* (*asar_getalldefines)(int* count);
205207

206208
/* Parses a string containing math. It automatically assumes global scope (no
207209
* namespaces), and has access to all functions and labels from the last call
208210
* to asar_patch. Remember to check error to see if it's successful (NULL) or
209211
* if it failed (non-NULL, contains a descriptive string). It does not affect
210212
* asar_geterrors.
211213
*/
212-
extern double (*asar_math)(const char * math_, const char ** error);
214+
extern double (*asar_math)(const char* math_, const char** error);
213215

214216
/* Get a list of all the blocks written to the ROM by calls such as
215217
* asar_patch().
216218
*/
217-
extern const struct writtenblockdata * (*asar_getwrittenblocks)(int * count);
219+
extern const struct writtenblockdata* (*asar_getwrittenblocks)(int* count);
218220

219221
/* Get the mapper currently used by Asar.
220222
*/
221223
extern enum mappertype (*asar_getmapper)(void);
222224

223225
/* Generates the contents of a symbols file for in a specific format.
224226
*/
225-
extern const char * (*asar_getsymbolsfile)(const char* type);
227+
extern const char* (*asar_getsymbolsfile)(const char* type);
226228

227229
#ifdef __cplusplus
228-
}
230+
}
229231
#endif
230232

231-
#endif // ASAR_DLL_H_INCLUDED
233+
#endif // ASAR_DLL_H_INCLUDED

0 commit comments

Comments
 (0)