mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
syntax: Use STREQ/STRNEQ in place of strcmp.
Found by 'make syntax-check'.
This commit is contained in:
@@ -47,6 +47,8 @@ let rec generate_perl_xs () =
|
||||
|
||||
#include <guestfs.h>
|
||||
|
||||
#define STREQ(a,b) (strcmp((a),(b)) == 0)
|
||||
|
||||
static SV *
|
||||
my_newSVll(long long val) {
|
||||
#ifdef USE_64_BIT_ALL
|
||||
@@ -434,7 +436,7 @@ user_cancel (g)
|
||||
fun argt ->
|
||||
let n = name_of_optargt argt in
|
||||
let uc_n = String.uppercase n in
|
||||
pr "if (strcmp (this_arg, \"%s\") == 0) {\n" n;
|
||||
pr "if (STREQ (this_arg, \"%s\")) {\n" n;
|
||||
(match argt with
|
||||
| OBool _
|
||||
| OInt _ ->
|
||||
|
||||
@@ -1067,7 +1067,7 @@ mdadm_app_cmp(const void *x, const void *y)
|
||||
const mdadm_app *a = x;
|
||||
const mdadm_app *b = y;
|
||||
|
||||
return strcmp(a->mdadm, b->mdadm) == 0;
|
||||
return STREQ (a->mdadm, b->mdadm);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -184,7 +184,7 @@ start_thread (void *vi)
|
||||
* building code which is what this regression test is designed to
|
||||
* spot.
|
||||
*/
|
||||
if (strcmp (error, "child process died unexpectedly") != 0) {
|
||||
if (STRNEQ (error, "child process died unexpectedly")) {
|
||||
fprintf (stderr, "rhbz790721: [thread %d]: error: %s\n", thread_id, error);
|
||||
*(int *)vi = -1;
|
||||
pthread_exit (vi);
|
||||
|
||||
Reference in New Issue
Block a user