Author: julianfoad
Date: Wed Jan  9 21:02:33 2013
New Revision: 1431072

URL: http://svn.apache.org/viewvc?rev=1431072&view=rev
Log:
Consistify a few remaining redundant or odd expressions involving boolean
constants, such as "foo == FALSE" to "!foo" and "number ? FALSE : TRUE" to
"number != 0".  A follow-up to r1431017 and r1431040.

* subversion/include/svn_types.h
  (svn_depth_from_word): Simplify "boolean ? TRUE : FALSE".

* subversion/libsvn_subr/named_atomic.c
  (svn_named_atomic__is_supported): Same.

* subversion/libsvn_subr/stream.c
  (svn_stream_supports_mark): Similar.

* subversion/libsvn_client/copy.c
  (try_copy): Simplify "x == TRUE" and similar.

* subversion/tests/libsvn_subr/mergeinfo-test.c
  (test_rangelist_to_string, test_mergeinfo_to_string): Same.

* subversion/libsvn_ra_serf/commit.c
  (open_root): Change "pointer ? TRUE : FALSE" to "pointer != NULL".

* subversion/svnadmin/svnadmin.c
  (subcommand_load): Same.

* subversion/mod_dav_svn/reports/replay.c
  (dav_svn__replay_report): Change "number ? TRUE : FALSE" to "number != 0".

Modified:
    subversion/trunk/subversion/include/svn_types.h
    subversion/trunk/subversion/libsvn_client/copy.c
    subversion/trunk/subversion/libsvn_ra_serf/commit.c
    subversion/trunk/subversion/libsvn_subr/named_atomic.c
    subversion/trunk/subversion/libsvn_subr/stream.c
    subversion/trunk/subversion/mod_dav_svn/reports/replay.c
    subversion/trunk/subversion/svnadmin/svnadmin.c
    subversion/trunk/subversion/tests/libsvn_subr/mergeinfo-test.c

Modified: subversion/trunk/subversion/include/svn_types.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_types.h?rev=1431072&r1=1431071&r2=1431072&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_types.h (original)
+++ subversion/trunk/subversion/include/svn_types.h Wed Jan  9 21:02:33 2013
@@ -550,8 +550,7 @@ svn_depth_from_word(const char *word);
  * non-recursive (which in turn usually translates to #svn_depth_files).
  */
 #define SVN_DEPTH_IS_RECURSIVE(depth)                              \
-  (((depth) == svn_depth_infinity || (depth) == svn_depth_unknown) \
-   ? TRUE : FALSE)
+  ((depth) == svn_depth_infinity || (depth) == svn_depth_unknown)
 
 
 

Modified: subversion/trunk/subversion/libsvn_client/copy.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/copy.c?rev=1431072&r1=1431071&r2=1431072&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/copy.c (original)
+++ subversion/trunk/subversion/libsvn_client/copy.c Wed Jan  9 21:02:33 2013
@@ -2181,8 +2181,7 @@ try_copy(const apr_array_header_t *sourc
       else
         {
           /* We ignore these values, so assert the default value */
-          SVN_ERR_ASSERT(allow_mixed_revisions == TRUE
-                         && metadata_only == FALSE);
+          SVN_ERR_ASSERT(allow_mixed_revisions && !metadata_only);
           return svn_error_trace(do_wc_to_wc_copies(copy_pairs, ctx, pool));
         }
     }

Modified: subversion/trunk/subversion/libsvn_ra_serf/commit.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/commit.c?rev=1431072&r1=1431071&r2=1431072&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/commit.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/commit.c Wed Jan  9 21:02:33 2013
@@ -1294,9 +1294,9 @@ open_root(void *edit_baton,
     {
       post_response_ctx_t *prc;
       const char *rel_path;
-      svn_boolean_t post_with_revprops =
-        apr_hash_get(ctx->session->supported_posts, "create-txn-with-props",
-                     APR_HASH_KEY_STRING) ? TRUE : FALSE;
+      svn_boolean_t post_with_revprops
+        = (apr_hash_get(ctx->session->supported_posts, "create-txn-with-props",
+                        APR_HASH_KEY_STRING) != NULL);
 
       /* Create our activity URL now on the server. */
       handler = apr_pcalloc(ctx->pool, sizeof(*handler));

Modified: subversion/trunk/subversion/libsvn_subr/named_atomic.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/named_atomic.c?rev=1431072&r1=1431071&r2=1431072&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/named_atomic.c (original)
+++ subversion/trunk/subversion/libsvn_subr/named_atomic.c Wed Jan  9 21:02:33 
2013
@@ -372,7 +372,7 @@ svn_named_atomic__is_supported(void)
         result = svn_tristate_false;
     }
 
-  return result == svn_tristate_true ? TRUE : FALSE;
+  return result == svn_tristate_true;
 #else
   return TRUE;
 #endif

Modified: subversion/trunk/subversion/libsvn_subr/stream.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/stream.c?rev=1431072&r1=1431071&r2=1431072&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/stream.c (original)
+++ subversion/trunk/subversion/libsvn_subr/stream.c Wed Jan  9 21:02:33 2013
@@ -173,7 +173,7 @@ svn_stream_reset(svn_stream_t *stream)
 svn_boolean_t
 svn_stream_supports_mark(svn_stream_t *stream)
 {
-  return stream->mark_fn == NULL ? FALSE : TRUE;
+  return stream->mark_fn != NULL;
 }
 
 svn_error_t *

Modified: subversion/trunk/subversion/mod_dav_svn/reports/replay.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/mod_dav_svn/reports/replay.c?rev=1431072&r1=1431071&r2=1431072&view=diff
==============================================================================
--- subversion/trunk/subversion/mod_dav_svn/reports/replay.c (original)
+++ subversion/trunk/subversion/mod_dav_svn/reports/replay.c Wed Jan  9 
21:02:33 2013
@@ -481,7 +481,7 @@ dav_svn__replay_report(const dav_resourc
                   svn_error_clear(err);
                   return malformed_element_error("send-deltas", 
resource->pool);
                 }
-              send_deltas = parsed_val ? TRUE : FALSE;
+              send_deltas = parsed_val != 0;
             }
         }
     }

Modified: subversion/trunk/subversion/svnadmin/svnadmin.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/svnadmin/svnadmin.c?rev=1431072&r1=1431071&r2=1431072&view=diff
==============================================================================
--- subversion/trunk/subversion/svnadmin/svnadmin.c (original)
+++ subversion/trunk/subversion/svnadmin/svnadmin.c Wed Jan  9 21:02:33 2013
@@ -1150,7 +1150,7 @@ subcommand_load(apr_getopt_t *os, void *
                            opt_state->uuid_action, opt_state->parent_dir,
                            opt_state->use_pre_commit_hook,
                            opt_state->use_post_commit_hook,
-                           opt_state->bypass_prop_validation ? FALSE : TRUE,
+                           !opt_state->bypass_prop_validation,
                            opt_state->quiet ? NULL : repos_notify_handler,
                            stdout_stream, check_cancel, NULL, pool);
   if (err && err->apr_err == SVN_ERR_BAD_PROPERTY_VALUE)

Modified: subversion/trunk/subversion/tests/libsvn_subr/mergeinfo-test.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/mergeinfo-test.c?rev=1431072&r1=1431071&r2=1431072&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/mergeinfo-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/mergeinfo-test.c Wed Jan  9 
21:02:33 2013
@@ -1117,7 +1117,7 @@ test_rangelist_to_string(apr_pool_t *poo
 
   SVN_ERR(svn_rangelist_to_string(&output, result, pool));
 
-  if (svn_string_compare(expected, output) != TRUE)
+  if (!svn_string_compare(expected, output))
     return fail(pool, "Rangelist string not what we expected");
 
   return SVN_NO_ERROR;
@@ -1134,7 +1134,7 @@ test_mergeinfo_to_string(apr_pool_t *poo
 
   SVN_ERR(svn_mergeinfo_to_string(&output, info1, pool));
 
-  if (svn_string_compare(expected, output) != TRUE)
+  if (!svn_string_compare(expected, output))
     return fail(pool, "Mergeinfo string not what we expected");
 
   /* Manually construct some mergeinfo with relative path
@@ -1150,7 +1150,7 @@ test_mergeinfo_to_string(apr_pool_t *poo
                apr_hash_get(info1, "/trunk", APR_HASH_KEY_STRING));
   SVN_ERR(svn_mergeinfo_to_string(&output, info2, pool));
 
-  if (svn_string_compare(expected, output) != TRUE)
+  if (!svn_string_compare(expected, output))
     return fail(pool, "Mergeinfo string not what we expected");
 
   return SVN_NO_ERROR;


Reply via email to