Use stdstring.h

This commit is contained in:
twinaphex 2016-09-16 17:25:47 +02:00
parent 5698bd489c
commit f395e851c4
5 changed files with 11 additions and 7 deletions

View File

@ -32,6 +32,7 @@
#endif #endif
#include <compat/strl.h> #include <compat/strl.h>
#include <string/stdstring.h>
#include <file/file_path.h> #include <file/file_path.h>
#ifndef IS_SALAMANDER #ifndef IS_SALAMANDER
#include <lists/file_list.h> #include <lists/file_list.h>
@ -125,7 +126,7 @@ static void frontend_ps3_get_environment_settings(int *argc, char *argv[],
/* not launched from external launcher, set default path */ /* not launched from external launcher, set default path */
// second param is multiMAN SELF file // second param is multiMAN SELF file
if(path_file_exists(argv[2]) && *argc > 1 if(path_file_exists(argv[2]) && *argc > 1
&& (!strcmp(argv[2], EMULATOR_CONTENT_DIR))) && (string_is_equal(argv[2], EMULATOR_CONTENT_DIR)))
{ {
multiman_detected = true; multiman_detected = true;
RARCH_LOG("Started from multiMAN, auto-game start enabled.\n"); RARCH_LOG("Started from multiMAN, auto-game start enabled.\n");

View File

@ -17,6 +17,7 @@
#include <string.h> #include <string.h>
#include <compat/strl.h> #include <compat/strl.h>
#include <string/stdstring.h>
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "../config.h" #include "../config.h"
@ -82,7 +83,7 @@ frontend_ctx_driver_t *frontend_ctx_find_driver(const char *ident)
for (i = 0; frontend_ctx_drivers[i]; i++) for (i = 0; frontend_ctx_drivers[i]; i++)
{ {
if (!strcmp(frontend_ctx_drivers[i]->ident, ident)) if (string_is_equal(frontend_ctx_drivers[i]->ident, ident))
return frontend_ctx_drivers[i]; return frontend_ctx_drivers[i];
} }

View File

@ -133,7 +133,7 @@ static void salamander_init(char *s, size_t len)
config_get_array(conf, "libretro_path", tmp_str, sizeof(tmp_str)); config_get_array(conf, "libretro_path", tmp_str, sizeof(tmp_str));
config_file_free(conf); config_file_free(conf);
if (strcmp(tmp_str, "builtin") != 0) if (!string_is_equal(tmp_str, "builtin"))
strlcpy(s, tmp_str, len); strlcpy(s, tmp_str, len);
} }
#ifdef GEKKO #ifdef GEKKO
@ -146,7 +146,7 @@ static void salamander_init(char *s, size_t len)
#endif #endif
} }
if (!config_file_exists || !strcmp(s, "")) if (!config_file_exists || string_is_equal(s, ""))
{ {
char executable_name[PATH_MAX_LENGTH]; char executable_name[PATH_MAX_LENGTH];

View File

@ -28,6 +28,7 @@
#include <net/net_compat.h> #include <net/net_compat.h>
#include <net/net_socket.h> #include <net/net_socket.h>
#include <compat/strl.h> #include <compat/strl.h>
#include <string/stdstring.h>
enum enum
{ {
@ -350,7 +351,7 @@ bool net_http_update(struct http_t *state, size_t* progress, size_t* total)
state->len = strtol(state->data + state->len = strtol(state->data +
strlen("Content-Length: "), NULL, 10); strlen("Content-Length: "), NULL, 10);
} }
if (!strcmp(state->data, "Transfer-Encoding: chunked")) if (string_is_equal(state->data, "Transfer-Encoding: chunked"))
state->bodytype = T_CHUNK; state->bodytype = T_CHUNK;
/* TODO: save headers somewhere */ /* TODO: save headers somewhere */

View File

@ -13,9 +13,10 @@ CFLAGS += -Wall -pedantic -std=gnu99
HTTP_TEST_C = \ HTTP_TEST_C = \
$(LIBRETRO_COMM_DIR)/net/net_http.c \ $(LIBRETRO_COMM_DIR)/net/net_http.c \
net_http_test.c \
$(LIBRETRO_COMM_DIR)/net/net_compat.c \ $(LIBRETRO_COMM_DIR)/net/net_compat.c \
$(LIBRETRO_COMM_DIR)/compat/compat_strl.c $(LIBRETRO_COMM_DIR)/compat/compat_strl.c \
$(LIBRETRO_COMM_DIR)/string/stdstring.c \
net_http_test.c
HTTP_TEST_OBJS := $(HTTP_TEST_C:.c=.o) HTTP_TEST_OBJS := $(HTTP_TEST_C:.c=.o)