Commit c987a7aa authored by Vivien Kraus's avatar Vivien Kraus

Re-indentation

parent 9b61d9db
Pipeline #109940 passed with stages
in 3 minutes and 35 seconds
......@@ -24,15 +24,14 @@
#define _(String) dgettext (PACKAGE, String)
#define N_(String) (String)
static const char *names[6] =
{
N_ ("P1"),
N_ ("P2"),
N_ ("P3"),
N_ ("P4"),
N_ ("P5"),
N_ ("P6")
};
static const char *names[6] = {
N_("P1"),
N_("P2"),
N_("P3"),
N_("P4"),
N_("P5"),
N_("P6")
};
static inline TarotPlayer
player_parse (const char *text, char **end)
......@@ -43,13 +42,13 @@ player_parse (const char *text, char **end)
{
const char *candidate = gettext (names[i]);
if (strncmp (text, candidate, strlen (candidate)) == 0)
{
ret = (TarotPlayer) i;
if (end)
{
*end = (char *) text + strlen (candidate);
}
}
{
ret = (TarotPlayer) i;
if (end)
{
*end = (char *) text + strlen (candidate);
}
}
}
if (ret == ((TarotPlayer) (-1)))
{
......@@ -67,13 +66,13 @@ player_parse_c (const char *text, char **end)
{
const char *candidate = names[i];
if (strncmp (text, candidate, strlen (candidate)) == 0)
{
ret = (TarotPlayer) i;
if (end)
{
*end = (char *) text + strlen (candidate);
}
}
{
ret = (TarotPlayer) i;
if (end)
{
*end = (char *) text + strlen (candidate);
}
}
}
if (ret == ((TarotPlayer) (-1)))
{
......@@ -88,27 +87,27 @@ player_to_string (TarotPlayer p, size_t max, char *dest)
if (p >= 6)
{
if (max >= 1)
{
*dest = '\0';
}
{
*dest = '\0';
}
return 0;
}
{
const char *source = gettext (names[p]);
if (max == 0)
{
return strlen (source);
return strlen (source);
}
else if (max > strlen (source))
{
strcpy (dest, source);
return strlen (source);
strcpy (dest, source);
return strlen (source);
}
else
{
strncpy (dest, source, max);
dest[max - 1] = '\0';
return strlen (source);
strncpy (dest, source, max);
dest[max - 1] = '\0';
return strlen (source);
}
}
}
......@@ -119,27 +118,27 @@ player_to_string_c (TarotPlayer p, size_t max, char *dest)
if (p >= 6)
{
if (max >= 1)
{
*dest = '\0';
}
{
*dest = '\0';
}
return 0;
}
{
const char *source = names[p];
if (max == 0)
{
return strlen (source);
return strlen (source);
}
else if (max > strlen (source))
{
strcpy (dest, source);
return strlen (source);
strcpy (dest, source);
return strlen (source);
}
else
{
strncpy (dest, source, max);
dest[max - 1] = '\0';
return strlen (source);
strncpy (dest, source, max);
dest[max - 1] = '\0';
return strlen (source);
}
}
}
......
......@@ -39,7 +39,7 @@ extern "C"
#endif /* __cplusplus */
void tarot_set_localedir (const char *localedir);
int tarot_init (void);
void tarot_quit (void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment