Skip to content

Commit c342d94

Browse files
committed
Format decls according to C style guidelines
This partially reverts commit 96fda1c.
1 parent 68df35f commit c342d94

File tree

1 file changed

+91
-91
lines changed

1 file changed

+91
-91
lines changed

src/vips/cdefs.lua

Lines changed: 91 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -20,68 +20,68 @@ ffi.cdef [[
2020
uint64_t data[2];
2121
} GValue;
2222

23-
void* g_malloc(size_t size);
24-
void g_free(void* data);
23+
void *g_malloc (size_t size);
24+
void g_free (void *data);
2525

26-
void g_object_ref (void* object);
27-
void g_object_unref (void* object);
26+
void g_object_ref (void *object);
27+
void g_object_unref (void *object);
2828

29-
void g_value_init (GValue* value, GType gtype);
30-
void g_value_unset (GValue* value);
31-
const char* g_type_name (GType gtype);
32-
GType g_type_from_name (const char* name);
29+
void g_value_init (GValue *value, GType gtype);
30+
void g_value_unset (GValue *value);
31+
const char *g_type_name (GType gtype);
32+
GType g_type_from_name (const char *name);
3333
GType g_type_fundamental (GType gtype);
3434

3535
GType vips_blend_mode_get_type (void);
3636
GType vips_band_format_get_type (void);
3737

38-
int vips_enum_from_nick (const char* domain,
39-
GType gtype, const char* str);
40-
const char* vips_enum_nick (GType gtype, int value);
41-
42-
void g_value_set_boolean (GValue* value, int v_boolean);
43-
void g_value_set_int (GValue* value, int i);
44-
void g_value_set_double (GValue* value, double d);
45-
void g_value_set_enum (GValue* value, int e);
46-
void g_value_set_flags (GValue* value, unsigned int f);
47-
void g_value_set_string (GValue* value, const char* str);
48-
void vips_value_set_ref_string (GValue* value, const char* str);
49-
void g_value_set_object (GValue* value, void* object);
50-
void vips_value_set_array_double (GValue* value,
51-
const double* array, int n);
52-
void vips_value_set_array_int (GValue* value,
53-
const int* array, int n);
54-
void vips_value_set_array_image (GValue* value, int n);
55-
void vips_value_set_blob (GValue* value,
56-
void (*free_fn)(void* data), void* data, size_t length);
57-
void vips_value_set_blob_free (GValue* value,
58-
void* data, size_t length);
59-
60-
int g_value_get_boolean (const GValue* value);
61-
int g_value_get_int (const GValue* value);
62-
double g_value_get_double (const GValue* value);
63-
int g_value_get_enum (const GValue* value);
64-
unsigned int g_value_get_flags (const GValue* value);
65-
const char* g_value_get_string (const GValue* value);
66-
const char* vips_value_get_ref_string (const GValue* value, size_t* length);
67-
void* g_value_get_object (const GValue* value);
68-
double* vips_value_get_array_double (const GValue* value, int* n);
69-
int* vips_value_get_array_int (const GValue* value, int* n);
70-
void* vips_value_get_blob (const GValue* value, size_t* length);
38+
int vips_enum_from_nick (const char *domain,
39+
GType gtype, const char *str);
40+
const char *vips_enum_nick (GType gtype, int value);
41+
42+
void g_value_set_boolean (GValue *value, int v_boolean);
43+
void g_value_set_int (GValue *value, int i);
44+
void g_value_set_double (GValue *value, double d);
45+
void g_value_set_enum (GValue *value, int e);
46+
void g_value_set_flags (GValue *value, unsigned int f);
47+
void g_value_set_string (GValue *value, const char *str);
48+
void vips_value_set_ref_string (GValue *value, const char *str);
49+
void g_value_set_object (GValue *value, void *object);
50+
void vips_value_set_array_double (GValue *value,
51+
const double *array, int n);
52+
void vips_value_set_array_int (GValue *value,
53+
const int *array, int n);
54+
void vips_value_set_array_image (GValue *value, int n);
55+
void vips_value_set_blob (GValue *value,
56+
void (*free_fn)(void *data), void *data, size_t length);
57+
void vips_value_set_blob_free (GValue *value,
58+
void *data, size_t length);
59+
60+
int g_value_get_boolean (const GValue *value);
61+
int g_value_get_int (const GValue *value);
62+
double g_value_get_double (const GValue *value);
63+
int g_value_get_enum (const GValue *value);
64+
unsigned int g_value_get_flags (const GValue *value);
65+
const char *g_value_get_string (const GValue *value);
66+
const char *vips_value_get_ref_string (const GValue *value, size_t *length);
67+
void *g_value_get_object (const GValue *value);
68+
double *vips_value_get_array_double (const GValue *value, int *n);
69+
int *vips_value_get_array_int (const GValue *value, int *n);
70+
void *vips_value_get_blob (const GValue *value, size_t *length);
7171

7272
typedef struct _GObject {
73-
void* g_type_instance;
73+
void *g_type_instance;
7474
unsigned int ref_count;
75-
void* qdata;
75+
void *qdata;
7676
} GObject;
7777

7878
typedef struct _VipsObject {
7979
GObject parent_instance;
8080
bool constructed;
8181
bool static_object;
82-
void* argument_table;
83-
char* nickname;
84-
char* description;
82+
void *argument_table;
83+
char *nickname;
84+
char *description;
8585
bool preclose;
8686
bool close;
8787
bool postclose;
@@ -93,9 +93,9 @@ ffi.cdef [[
9393
} VipsObjectClass;
9494

9595
typedef struct _GParamSpec {
96-
void* g_type_instance;
96+
void *g_type_instance;
9797

98-
const char* name;
98+
const char *name;
9999
unsigned int flags;
100100
GType value_type;
101101
GType owner_type;
@@ -104,7 +104,7 @@ ffi.cdef [[
104104
} GParamSpec;
105105

106106
typedef struct _VipsArgument {
107-
GParamSpec* pspec;
107+
GParamSpec *pspec;
108108
} VipsArgument;
109109

110110
typedef struct _VipsArgumentInstance {
@@ -128,80 +128,80 @@ ffi.cdef [[
128128
typedef struct _VipsArgumentClass {
129129
VipsArgument parent;
130130

131-
VipsObjectClass* object_class;
131+
VipsObjectClass *object_class;
132132
VipsArgumentFlags flags;
133133
int priority;
134134
uint64_t offset;
135135
} VipsArgumentClass;
136136

137-
int vips_object_get_argument (VipsObject* object,
138-
const char* name, GParamSpec** pspec,
139-
VipsArgumentClass** argument_class,
140-
VipsArgumentInstance** argument_instance);
137+
int vips_object_get_argument (VipsObject *object,
138+
const char *name, GParamSpec **pspec,
139+
VipsArgumentClass **argument_class,
140+
VipsArgumentInstance **argument_instance);
141141

142-
void g_object_set_property (VipsObject* object,
143-
const char* name, const GValue* value);
144-
void g_object_get_property (VipsObject* object,
145-
const char* name, GValue* value);
142+
void g_object_set_property (VipsObject *object,
143+
const char *name, const GValue *value);
144+
void g_object_get_property (VipsObject *object,
145+
const char *name, GValue *value);
146146

147147
void vips_object_print_all (void);
148148

149-
int vips_object_set_from_string (VipsObject* object, const char* options);
149+
int vips_object_set_from_string (VipsObject *object, const char *options);
150150

151151
typedef struct _VipsImage {
152152
VipsObject parent_instance;
153153

154154
// opaque
155155
} VipsImage;
156156

157-
const char* vips_foreign_find_load (const char* name);
158-
const char* vips_foreign_find_load_buffer (const void* data, size_t size);
159-
const char* vips_foreign_find_save (const char* name);
160-
const char* vips_foreign_find_save_buffer (const char* suffix);
157+
const char *vips_foreign_find_load (const char *name);
158+
const char *vips_foreign_find_load_buffer (const void *data, size_t size);
159+
const char *vips_foreign_find_save (const char *name);
160+
const char *vips_foreign_find_save_buffer (const char *suffix);
161161

162-
VipsImage* vips_image_new_matrix_from_array (int width, int height,
163-
const double* array, int size);
162+
VipsImage *vips_image_new_matrix_from_array (int width, int height,
163+
const double *array, int size);
164164

165-
VipsImage* vips_image_new_from_memory (const void* data, size_t size,
165+
VipsImage *vips_image_new_from_memory (const void *data, size_t size,
166166
int width, int height, int bands, int format);
167-
unsigned char* vips_image_write_to_memory (VipsImage* image,
168-
size_t* size_out);
167+
unsigned char *vips_image_write_to_memory (VipsImage *image,
168+
size_t *size_out);
169169

170-
VipsImage* vips_image_copy_memory (VipsImage* image);
170+
VipsImage *vips_image_copy_memory (VipsImage *image);
171171

172-
VipsImage** vips_value_get_array_image (const GValue* value, int* n);
172+
VipsImage **vips_value_get_array_image (const GValue *value, int *n);
173173

174-
GType vips_image_get_typeof (const VipsImage* image, const char* name);
175-
int vips_image_get (const VipsImage* image, const char* name,
176-
GValue* value_copy);
177-
void vips_image_set (VipsImage* image, const char* name, GValue* value);
178-
int vips_image_remove (VipsImage* image, const char* name);
174+
GType vips_image_get_typeof (const VipsImage *image, const char *name);
175+
int vips_image_get (const VipsImage *image, const char *name,
176+
GValue *value_copy);
177+
void vips_image_set (VipsImage *image, const char *name, GValue *value);
178+
int vips_image_remove (VipsImage *image, const char *name);
179179

180-
char* vips_filename_get_filename (const char* vips_filename);
181-
char* vips_filename_get_options (const char* vips_filename);
180+
char *vips_filename_get_filename (const char *vips_filename);
181+
char *vips_filename_get_options (const char *vips_filename);
182182

183183
typedef struct _VipsOperation {
184184
VipsObject parent_instance;
185185

186186
// opaque
187187
} VipsOperation;
188188

189-
VipsOperation* vips_operation_new (const char* name);
189+
VipsOperation *vips_operation_new (const char *name);
190190

191-
typedef void* (*VipsArgumentMapFn) (VipsOperation* object,
192-
GParamSpec* pspec,
193-
VipsArgumentClass* argument_class,
194-
VipsArgumentInstance* argument_instance,
195-
void* a, void* b);
191+
typedef void * (*VipsArgumentMapFn) (VipsOperation *object,
192+
GParamSpec *pspec,
193+
VipsArgumentClass *argument_class,
194+
VipsArgumentInstance *argument_instance,
195+
void *a, void *b);
196196

197-
void* vips_argument_map (VipsOperation* object,
198-
VipsArgumentMapFn fn, void* a, void* b);
197+
void *vips_argument_map (VipsOperation *object,
198+
VipsArgumentMapFn fn, void *a, void *b);
199199

200-
void vips_object_get_args (VipsOperation* object,
201-
const char*** names, int** flags, int* n_args);
200+
void vips_object_get_args (VipsOperation *object,
201+
const char ***names, int **flags, int *n_args);
202202

203-
VipsOperation* vips_cache_operation_build (VipsOperation* operation);
204-
void vips_object_unref_outputs (VipsOperation* operation);
203+
VipsOperation *vips_cache_operation_build (VipsOperation *operation);
204+
void vips_object_unref_outputs (VipsOperation *operation);
205205

206206
void vips_leak_set (int leak);
207207
void vips_cache_set_max (int max);
@@ -212,10 +212,10 @@ ffi.cdef [[
212212
void vips_cache_set_max_files (int max_files);
213213
int vips_cache_get_max_files (void);
214214

215-
int vips_init (const char* argv0);
215+
int vips_init (const char *argv0);
216216
int vips_version (int flag);
217217

218-
const char* vips_error_buffer (void);
218+
const char *vips_error_buffer (void);
219219
void vips_error_clear (void);
220220

221221
]]

0 commit comments

Comments
 (0)