Skip to content

Commit 4933231

Browse files
committed
Remove extra space before semicolon
1 parent 09df826 commit 4933231

File tree

6 files changed

+236
-236
lines changed

6 files changed

+236
-236
lines changed

ext/libmagic/definitions.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#define RB_UNWRAP(cookie) \
2-
magic_t *cookie ; \
3-
TypedData_Get_Struct(self, magic_t, &fileType, cookie) ; \
4-
if(!*cookie) rb_raise(rb_eFileClosedError, "Magic cookie already closed") ;
2+
magic_t *cookie; \
3+
TypedData_Get_Struct(self, magic_t, &fileType, cookie); \
4+
if(!*cookie) rb_raise(rb_eFileClosedError, "Magic cookie already closed");

ext/libmagic/func.h

Lines changed: 59 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
*/
1212

1313
VALUE _closeGlobal_(VALUE self) {
14-
RB_UNWRAP(cookie) ;
14+
RB_UNWRAP(cookie);
1515

16-
magic_close(*cookie) ;
17-
*cookie = NULL ;
18-
rb_ivar_set(self, rb_intern("@closed"), Qtrue) ;
19-
return self ;
16+
magic_close(*cookie);
17+
*cookie = NULL;
18+
rb_ivar_set(self, rb_intern("@closed"), Qtrue);
19+
return self;
2020
}
2121

2222
/*
@@ -37,7 +37,7 @@ VALUE _closeGlobal_(VALUE self) {
3737
*/
3838

3939
VALUE _loadGlobal_(VALUE self, VALUE dbPath) {
40-
char *databasePath = NULL ;
40+
char *databasePath = NULL;
4141

4242
if (RB_TYPE_P(dbPath, T_STRING)) {
4343
databasePath = StringValuePtr(dbPath);
@@ -46,16 +46,16 @@ VALUE _loadGlobal_(VALUE self, VALUE dbPath) {
4646

4747
// Check if the database is a valid file or not
4848
// Raises ruby error which will return.
49-
RB_UNWRAP(cookie) ;
49+
RB_UNWRAP(cookie);
5050

51-
if(databasePath) magic_validate_db(*cookie, databasePath) ;
51+
if(databasePath) magic_validate_db(*cookie, databasePath);
5252

5353
if (magic_load(*cookie, databasePath) == -1) {
54-
rb_raise(rb_eRuntimeError, "Failed to load magic database: %s", magic_error(*cookie)) ;
54+
rb_raise(rb_eRuntimeError, "Failed to load magic database: %s", magic_error(*cookie));
5555
}
5656

5757

58-
return self ;
58+
return self;
5959
}
6060

6161
/*
@@ -73,30 +73,30 @@ VALUE _loadGlobal_(VALUE self, VALUE dbPath) {
7373
*/
7474

7575
VALUE _checkGlobal_(VALUE self) {
76-
RB_UNWRAP(cookie) ;
76+
RB_UNWRAP(cookie);
7777

7878
// Database path
79-
VALUE db = rb_iv_get(self, "@db") ;
79+
VALUE db = rb_iv_get(self, "@db");
8080

81-
char *database = NULL ;
81+
char *database = NULL;
8282
if(RB_TYPE_P(db, T_STRING)) {
83-
database = StringValuePtr(db) ;
83+
database = StringValuePtr(db);
8484
}
8585

8686
// File path
87-
VALUE f = rb_iv_get(self, "@file") ;
88-
char *file = StringValuePtr(f) ;
87+
VALUE f = rb_iv_get(self, "@file");
88+
char *file = StringValuePtr(f);
8989

90-
if(database) magic_validate_db(*cookie, database) ;
90+
if(database) magic_validate_db(*cookie, database);
9191

9292
if (magic_load(*cookie, database) == -1) {
93-
rb_raise(rb_eRuntimeError, "Failed to load magic database: %s", magic_error(*cookie)) ;
93+
rb_raise(rb_eRuntimeError, "Failed to load magic database: %s", magic_error(*cookie));
9494
}
9595

96-
fileReadable(file) ;
97-
const char *mt = magic_file(*cookie, file) ;
96+
fileReadable(file);
97+
const char *mt = magic_file(*cookie, file);
9898

99-
return mt ? rb_str_new_cstr(mt) : Qnil ;
99+
return mt ? rb_str_new_cstr(mt) : Qnil;
100100
}
101101

102102
/*
@@ -113,16 +113,16 @@ VALUE _checkGlobal_(VALUE self) {
113113

114114
VALUE _getParamGlobal_(VALUE self, VALUE param) {
115115
#if MAGIC_VERSION > 525
116-
RB_UNWRAP(cookie) ;
116+
RB_UNWRAP(cookie);
117117

118-
unsigned int _param = NUM2UINT(param) ;
119-
unsigned long value ;
118+
unsigned int _param = NUM2UINT(param);
119+
unsigned long value;
120120

121-
int status = magic_getparam(*cookie, _param, &value) ;
122-
if (status) return Qnil ;
123-
return ULONG2NUM(value) ;
121+
int status = magic_getparam(*cookie, _param, &value);
122+
if (status) return Qnil;
123+
return ULONG2NUM(value);
124124
#else
125-
return Qnil ;
125+
return Qnil;
126126
#endif
127127
}
128128

@@ -149,20 +149,20 @@ VALUE _getParamGlobal_(VALUE self, VALUE param) {
149149

150150
VALUE _setParamGlobal_(VALUE self, VALUE param, VALUE paramVal) {
151151
#if MAGIC_VERSION > 525
152-
unsigned int _param = NUM2UINT(param) ;
153-
unsigned long _paramVal = NUM2ULONG(paramVal) ;
152+
unsigned int _param = NUM2UINT(param);
153+
unsigned long _paramVal = NUM2ULONG(paramVal);
154154

155-
RB_UNWRAP(cookie) ;
155+
RB_UNWRAP(cookie);
156156

157-
unsigned long value ;
158-
magic_setparam(*cookie, _param, &_paramVal) ;
157+
unsigned long value;
158+
magic_setparam(*cookie, _param, &_paramVal);
159159

160-
int status = magic_getparam(*cookie, _param, &value) ;
161-
if (status) return Qnil ;
160+
int status = magic_getparam(*cookie, _param, &value);
161+
if (status) return Qnil;
162162

163-
return ULONG2NUM((int)value) ;
163+
return ULONG2NUM((int)value);
164164
#else
165-
return Qnil ;
165+
return Qnil;
166166
#endif
167167
}
168168

@@ -186,25 +186,25 @@ VALUE _setParamGlobal_(VALUE self, VALUE param, VALUE paramVal) {
186186
*/
187187

188188
VALUE _bufferGlobal_(VALUE self, VALUE string) {
189-
RB_UNWRAP(cookie) ;
189+
RB_UNWRAP(cookie);
190190

191-
VALUE db = rb_iv_get(self, "@db") ;
191+
VALUE db = rb_iv_get(self, "@db");
192192

193-
char *database = NULL ;
193+
char *database = NULL;
194194
if(RB_TYPE_P(db, T_STRING)) {
195-
database = StringValuePtr(db) ;
195+
database = StringValuePtr(db);
196196
}
197197

198-
if(database) magic_validate_db(*cookie, database) ;
198+
if(database) magic_validate_db(*cookie, database);
199199

200200
if (magic_load(*cookie, database) == -1) {
201-
rb_raise(rb_eRuntimeError, "Failed to load magic database: %s", magic_error(*cookie)) ;
201+
rb_raise(rb_eRuntimeError, "Failed to load magic database: %s", magic_error(*cookie));
202202
}
203203

204-
char *buffer = StringValuePtr(string) ;
205-
const char *buf = magic_buffer(*cookie, buffer, strlen(buffer)) ;
204+
char *buffer = StringValuePtr(string);
205+
const char *buf = magic_buffer(*cookie, buffer, strlen(buffer));
206206

207-
return buf ? rb_str_new_cstr(buf) : Qnil ;
207+
return buf ? rb_str_new_cstr(buf) : Qnil;
208208
}
209209

210210
/*
@@ -238,19 +238,19 @@ VALUE _bufferGlobal_(VALUE self, VALUE string) {
238238
*/
239239

240240
VALUE _listGlobal_(VALUE self) {
241-
RB_UNWRAP(cookie) ;
241+
RB_UNWRAP(cookie);
242242

243-
VALUE db = rb_iv_get(self, "@db") ;
243+
VALUE db = rb_iv_get(self, "@db");
244244

245-
char *database = NULL ;
245+
char *database = NULL;
246246
if (RB_TYPE_P(db, T_STRING)) {
247-
database = StringValuePtr(db) ;
247+
database = StringValuePtr(db);
248248
}
249249

250-
if(database) magic_validate_db(*cookie, database) ;
251-
int status = magic_list(*cookie, database) ;
250+
if(database) magic_validate_db(*cookie, database);
251+
int status = magic_list(*cookie, database);
252252

253-
return INT2FIX(status) ;
253+
return INT2FIX(status);
254254
}
255255

256256
/*
@@ -285,15 +285,15 @@ VALUE _listGlobal_(VALUE self) {
285285
*/
286286

287287
VALUE _setflagsGlobal_(VALUE self, VALUE flags) {
288-
unsigned int flag = NUM2UINT(flags) ;
288+
unsigned int flag = NUM2UINT(flags);
289289

290-
RB_UNWRAP(cookie) ;
291-
int status = magic_setflags(*cookie, flag) ;
290+
RB_UNWRAP(cookie);
291+
int status = magic_setflags(*cookie, flag);
292292

293293
if (status) {
294-
return Qnil ;
294+
return Qnil;
295295
} else {
296-
rb_ivar_set(self, rb_intern("@mode"), flags) ;
297-
return flags ;
296+
rb_ivar_set(self, rb_intern("@mode"), flags);
297+
return flags;
298298
}
299299
}

0 commit comments

Comments
 (0)