Use string_is_empty

This commit is contained in:
twinaphex 2015-12-26 07:59:15 +01:00
parent 697351ee67
commit c2d7cbe18b
4 changed files with 11 additions and 6 deletions

View File

@ -30,6 +30,7 @@
#include <formats/image.h>
#include <retro_inline.h>
#include <retro_miscellaneous.h>
#include <string/stdstring.h>
#include "../../driver.h"
#include "../../record/record_driver.h"
@ -2501,7 +2502,7 @@ static void *gl_init(const video_info_t *video, const input_driver_t **input, vo
RARCH_LOG("[GL]: Vendor: %s, Renderer: %s.\n", vendor, renderer);
RARCH_LOG("[GL]: Version: %s.\n", version);
if (version && version[0] != '\0')
if (!string_is_empty(version))
sscanf(version, "%d.%d", &gl->version_major, &gl->version_minor);
#ifndef RARCH_CONSOLE

View File

@ -18,6 +18,7 @@
#include <sys/system_properties.h>
#include <formats/image.h>
#include <string/stdstring.h>
#include "../../driver.h"
#include "../../general.h"
@ -220,7 +221,7 @@ static void dpi_get_density(char *s, size_t len)
{
system_property_get("getprop", "ro.sf.lcd_density", s);
if (s[0] == '\0')
if (string_is_empty(s))
system_property_get("wm", "density", s);
}
@ -240,7 +241,7 @@ static bool android_gfx_ctx_get_metrics(void *data,
if (dpi == -1)
{
dpi_get_density(density, sizeof(density));
if (density[0] == '\0')
if (string_is_empty(density))
return false;
dpi = atoi(density);
}

View File

@ -14,6 +14,8 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#include <string/stdstring.h>
#include "shader_hlsl.h"
#include "../video_shader_parse.h"
@ -256,7 +258,7 @@ static bool hlsl_load_plain(hlsl_shader_data_t *hlsl, void *data, const char *pa
hlsl->cg_shader->passes = 1;
if (path && path[0] != '\0')
if (!string_is_empty(path))
{
RARCH_LOG("Loading Cg/HLSL file: %s\n", path);
strlcpy(hlsl->cg_shader->pass[0].source.path,

View File

@ -19,6 +19,7 @@
#include <boolean.h>
#include <file/file_path.h>
#include <retro_miscellaneous.h>
#include <string/stdstring.h>
#include <string/string_list.h>
#include "cocoa_common.h"
@ -122,7 +123,7 @@ static void RunActionSheet(const char* title, const struct string_list* items,
result.textLabel.text = BOXSTRING(label);
if (label[0] == '\0')
if (string_is_empty(label))
strlcpy(buffer, "N/A", sizeof(buffer));
result.detailTextLabel.text = BOXSTRING(buffer);
return result;
@ -426,7 +427,7 @@ replacementString:(NSString *)string
field.delegate = self.formatter;
menu_entry_get_value(self.i, buffer, sizeof(buffer));
if (buffer[0] == '\0')
if (string_is_empty(buffer))
strlcpy(buffer, "N/A", sizeof(buffer));
field.placeholder = BOXSTRING(buffer);