Skip to content

Commit d080d67

Browse files
committed
Rename STATUS to status_t
1 parent 70edb63 commit d080d67

File tree

2 files changed

+15
-20
lines changed

2 files changed

+15
-20
lines changed

src/xyz.c

+5-10
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@
2222
#include "gui.h"
2323
#endif
2424

25-
// #ifdef USE_SBGC
26-
// #define SBGC_IMPLEMENTATION
27-
// #include "sbgc.h"
28-
// #endif
29-
3025
/*****************************************************************************
3126
* FILE SYSTEM
3227
*****************************************************************************/
@@ -1790,7 +1785,7 @@ timestamp_t sec2ts(const real_t time_s) { return time_s * 1e9; }
17901785
* - 0 for success
17911786
* - -1 for failure
17921787
*/
1793-
STATUS ip_port_info(const int sockfd, char *ip, int *port) {
1788+
status_t ip_port_info(const int sockfd, char *ip, int *port) {
17941789
assert(ip != NULL);
17951790
assert(port != NULL);
17961791

@@ -1823,7 +1818,7 @@ STATUS ip_port_info(const int sockfd, char *ip, int *port) {
18231818
/**
18241819
* Configure TCP server
18251820
*/
1826-
STATUS tcp_server_setup(tcp_server_t *server, const int port) {
1821+
status_t tcp_server_setup(tcp_server_t *server, const int port) {
18271822
assert(server != NULL);
18281823

18291824
// Setup server struct
@@ -1869,7 +1864,7 @@ STATUS tcp_server_setup(tcp_server_t *server, const int port) {
18691864
* Loop TCP server
18701865
* @returns `0` for success, `-1` for failure
18711866
*/
1872-
STATUS tcp_server_loop(tcp_server_t *server) {
1867+
status_t tcp_server_loop(tcp_server_t *server) {
18731868
assert(server != NULL);
18741869

18751870
// Server is ready to listen
@@ -1901,7 +1896,7 @@ STATUS tcp_server_loop(tcp_server_t *server) {
19011896
/**
19021897
* Configure TCP client
19031898
*/
1904-
STATUS tcp_client_setup(tcp_client_t *client,
1899+
status_t tcp_client_setup(tcp_client_t *client,
19051900
const char *server_ip,
19061901
const int server_port) {
19071902
assert(client != NULL);
@@ -1938,7 +1933,7 @@ STATUS tcp_client_setup(tcp_client_t *client,
19381933
/**
19391934
* Loop TCP client
19401935
*/
1941-
STATUS tcp_client_loop(tcp_client_t *client) {
1936+
status_t tcp_client_loop(tcp_client_t *client) {
19421937
while (1) {
19431938
if (client->loop_cb) {
19441939
int retval = client->loop_cb(client);

src/xyz.h

+10-10
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ extern "C" {
7777
* LOGGING / MACROS
7878
******************************************************************************/
7979

80-
#ifndef STATUS
81-
#define STATUS __attribute__((warn_unused_result)) int
80+
#ifndef status_t
81+
#define status_t __attribute__((warn_unused_result)) int
8282
#endif
8383

8484
/** Terminal ANSI colors */
@@ -300,9 +300,9 @@ char **list_files(const char *path, int *num_files);
300300
void list_files_free(char **data, const int n);
301301
char *file_read(const char *fp);
302302
void skip_line(FILE *fp);
303-
STATUS file_exists(const char *fp);
304-
STATUS file_rows(const char *fp);
305-
STATUS file_copy(const char *src, const char *dest);
303+
status_t file_exists(const char *fp);
304+
status_t file_rows(const char *fp);
305+
status_t file_copy(const char *src, const char *dest);
306306

307307
/*******************************************************************************
308308
* DATA
@@ -546,15 +546,15 @@ typedef struct tcp_client_t {
546546
int (*loop_cb)(struct tcp_client_t *);
547547
} tcp_client_t;
548548

549-
STATUS ip_port_info(const int sockfd, char *ip, int *port);
549+
status_t ip_port_info(const int sockfd, char *ip, int *port);
550550

551-
STATUS tcp_server_setup(tcp_server_t *server, const int port);
552-
STATUS tcp_server_loop(tcp_server_t *server);
551+
status_t tcp_server_setup(tcp_server_t *server, const int port);
552+
status_t tcp_server_loop(tcp_server_t *server);
553553

554-
STATUS tcp_client_setup(tcp_client_t *client,
554+
status_t tcp_client_setup(tcp_client_t *client,
555555
const char *server_ip,
556556
const int server_port);
557-
STATUS tcp_client_loop(tcp_client_t *client);
557+
status_t tcp_client_loop(tcp_client_t *client);
558558

559559
/*******************************************************************************
560560
* MATHS

0 commit comments

Comments
 (0)