Skip to content

Commit

Permalink
format code style
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangjipeng committed Dec 27, 2023
1 parent 1f12c7b commit f74b645
Show file tree
Hide file tree
Showing 88 changed files with 3,710 additions and 3,665 deletions.
6 changes: 3 additions & 3 deletions ext/image_loader/psx_color_convert.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
#include <stdlib.h>

#if defined(__GNUC__)
#define INLINE inline
#define INLINE inline
#elif defined(_MSC_VER)
#define INLINE __inline
#define INLINE __inline
#else
#define INLINE
#define INLINE
#endif

/* 32 bit color convert */
Expand Down
12 changes: 5 additions & 7 deletions ext/image_loader/psx_image_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
#define _PSX_IMAGE_IO_H_

#if defined(WIN32) && defined(_MSC_VER)
#define PATH_MAX 1024
#define strdup(s) _strdup(s)
typedef wchar_t pchar;
#define PATH_MAX 1024
#define strdup(s) _strdup(s)
typedef wchar_t pchar;
#else
typedef char pchar;
typedef char pchar;
#endif

/* release pchar string create by pstring_create needed free() */
pchar* pstring_create(const char* str, size_t * rlen);
pchar* pstring_create(const char* str, size_t* rlen);

int _file_exists(const pchar* path);

Expand All @@ -28,7 +28,6 @@ int _file_write(const pchar* path, unsigned char* buffer, size_t buffer_size);

int _file_remove(const pchar* path);


typedef void* module_handle;

#define INVALID_HANDLE ((module_handle)0)
Expand All @@ -45,4 +44,3 @@ pchar* _module_get_modules_dir(pchar* path_buffer, size_t buffer_size);
size_t _module_get_modules(const pchar* dir_path, pchar* paths[], size_t num);

#endif /*_PSX_IMAGE_IO_H_*/

10 changes: 4 additions & 6 deletions ext/image_loader/psx_image_modules.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@

struct image_coder_node {
struct list_hdr head;
char* magic_hdr;
char* magic_hdr;
size_t magic_offset;
size_t magic_len;
int level;
char* type_name;
int level;
char* type_name;
psx_image_operator* op;
};

struct image_module_node {
module_handle handle;
pchar* path;
pchar* path;
};

struct image_modules_mgr {
Expand All @@ -33,7 +33,6 @@ struct image_modules_mgr {
size_t num_modules;
};


int modules_init(struct image_modules_mgr* mgr);

void modules_destroy(struct image_modules_mgr* mgr);
Expand All @@ -49,4 +48,3 @@ struct image_coder_node* get_next_operator_by_name(struct image_modules_mgr* mgr
struct image_coder_node* op, const char* type);

#endif /*_PSX_IMAGE_MODULE_MANAGER_H_*/

17 changes: 8 additions & 9 deletions ext/image_loader/psx_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
#define _PSX_LIST_H_

#if defined(__GNUC__)
#define INLINE inline
#define INLINE inline
#elif defined(_MSC_VER)
#define INLINE __inline
#define INLINE __inline
#else
#define INLINE
#define INLINE
#endif

struct list_hdr {
Expand All @@ -35,7 +35,7 @@ static INLINE int list_empty(const struct list_hdr* head)
}

#define list_add(head, value) \
list_add_entry((struct list_hdr*)(head), (struct list_hdr*)(value))
list_add_entry((struct list_hdr*)(head), (struct list_hdr*)(value))

static INLINE int list_add_entry(struct list_hdr* head, struct list_hdr* value)
{
Expand All @@ -49,7 +49,7 @@ static INLINE int list_add_entry(struct list_hdr* head, struct list_hdr* value)
}

#define list_add_tail(head, value) \
list_add_tail_entry((struct list_hdr*)(head), (struct list_hdr*)(value))
list_add_tail_entry((struct list_hdr*)(head), (struct list_hdr*)(value))

static INLINE int list_add_tail_entry(struct list_hdr* head, struct list_hdr* value)
{
Expand All @@ -63,7 +63,7 @@ static INLINE int list_add_tail_entry(struct list_hdr* head, struct list_hdr* va
}

#define list_remove(entry) \
list_remove_entry((struct list_hdr*)(entry))
list_remove_entry((struct list_hdr*)(entry))

static INLINE int list_remove_entry(struct list_hdr* entry)
{
Expand All @@ -74,10 +74,9 @@ static INLINE int list_remove_entry(struct list_hdr* entry)
}

#define list_for_each(head, iterator) \
for ((iterator) = (head)->next; (iterator) != (head); (iterator) = (iterator)->next)
for ((iterator) = (head)->next; (iterator) != (head); (iterator) = (iterator)->next)

#define list_for_each_start_with(head, start, iterator) \
for ((iterator) = ((struct list_hdr*)(start))->next; (iterator) != (head); (iterator) = (iterator)->next)
for ((iterator) = ((struct list_hdr*)(start))->next; (iterator) != (head); (iterator) = (iterator)->next)

#endif /*_PSX_LIST_H_*/

12 changes: 6 additions & 6 deletions ext/image_loader/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
// Used by psx_image.rc
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 101
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101
#endif
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 101
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
Loading

0 comments on commit f74b645

Please sign in to comment.