You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ko...@apache.org on 2021/12/21 21:36:48 UTC
svn commit: r1896256 - in /subversion/trunk/subversion: libsvn_ra_svn/marshal.c svn/info-cmd.c tests/libsvn_diff/diff-diff3-test.c
Author: kotkov
Date: Tue Dec 21 21:36:48 2021
New Revision: 1896256
URL: http://svn.apache.org/viewvc?rev=1896256&view=rev
Log:
Code cleanup: use the globally available SVN__STATIC_STRING() helper
instead of its locally defined equivalents such as MAKE_STRING(), etc…
* subversion/libsvn_ra_svn/marshal.c
(STATIC_SVN_STRING): Remove.
(changed_path_flags): Use SVN__STATIC_STRING().
* subversion/svn/info-cmd.c
(): Include svn_string_private.h.
(MAKE_STRING): Remove.
(info_item_map): Use SVN__STATIC_STRING().
* subversion/tests/libsvn_diff/diff-diff3-test.c
(): Include svn_string_private.h.
(MAKE_STRING): Remove.
(test_diff4): Use SVN__STATIC_STRING().
Modified:
subversion/trunk/subversion/libsvn_ra_svn/marshal.c
subversion/trunk/subversion/svn/info-cmd.c
subversion/trunk/subversion/tests/libsvn_diff/diff-diff3-test.c
Modified: subversion/trunk/subversion/libsvn_ra_svn/marshal.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_svn/marshal.c?rev=1896256&r1=1896255&r2=1896256&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_svn/marshal.c (original)
+++ subversion/trunk/subversion/libsvn_ra_svn/marshal.c Tue Dec 21 21:36:48 2021
@@ -2786,9 +2786,6 @@ svn_error_t *svn_ra_svn__write_cmd_failu
return writebuf_write_literal(conn, pool, ") ) ");
}
-/* Initializer for static svn_string_t . */
-#define STATIC_SVN_STRING(x) { x, sizeof(x) - 1 }
-
/* Return a pre-cooked serialized representation for the changed path
flags NODE_KIND, TEXT_MODIFIED and PROPS_MODIFIED. If we don't
have a suitable pre-cooked string, return an empty string. */
@@ -2798,18 +2795,18 @@ changed_path_flags(svn_node_kind_t node_
svn_boolean_t props_modified)
{
static const svn_string_t file_flags[4]
- = { STATIC_SVN_STRING(" ) ( 4:file false false ) ) "),
- STATIC_SVN_STRING(" ) ( 4:file false true ) ) "),
- STATIC_SVN_STRING(" ) ( 4:file true false ) ) "),
- STATIC_SVN_STRING(" ) ( 4:file true true ) ) ") };
+ = { SVN__STATIC_STRING(" ) ( 4:file false false ) ) "),
+ SVN__STATIC_STRING(" ) ( 4:file false true ) ) "),
+ SVN__STATIC_STRING(" ) ( 4:file true false ) ) "),
+ SVN__STATIC_STRING(" ) ( 4:file true true ) ) ") };
static const svn_string_t dir_flags[4]
- = { STATIC_SVN_STRING(" ) ( 3:dir false false ) ) "),
- STATIC_SVN_STRING(" ) ( 3:dir false true ) ) "),
- STATIC_SVN_STRING(" ) ( 3:dir true false ) ) "),
- STATIC_SVN_STRING(" ) ( 3:dir true true ) ) ") };
+ = { SVN__STATIC_STRING(" ) ( 3:dir false false ) ) "),
+ SVN__STATIC_STRING(" ) ( 3:dir false true ) ) "),
+ SVN__STATIC_STRING(" ) ( 3:dir true false ) ) "),
+ SVN__STATIC_STRING(" ) ( 3:dir true true ) ) ") };
- static const svn_string_t no_flags = STATIC_SVN_STRING("");
+ static const svn_string_t no_flags = SVN__STATIC_STRING("");
/* Select the array based on the NODE_KIND. */
const svn_string_t *flags;
Modified: subversion/trunk/subversion/svn/info-cmd.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/info-cmd.c?rev=1896256&r1=1896255&r2=1896256&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/info-cmd.c (original)
+++ subversion/trunk/subversion/svn/info-cmd.c Tue Dec 21 21:36:48 2021
@@ -46,6 +46,8 @@
#include "svn_private_config.h"
#include "cl-conflicts.h"
+#include "private/svn_string_private.h"
+
/*** Code. ***/
@@ -376,26 +378,24 @@ typedef struct info_item_map_t
const info_item_t print_what;
} info_item_map_t;
-#define MAKE_STRING(x) { x, sizeof(x) - 1 }
static const info_item_map_t info_item_map[] =
{
- { MAKE_STRING("kind"), info_item_kind },
- { MAKE_STRING("url"), info_item_url },
- { MAKE_STRING("relative-url"), info_item_relative_url },
- { MAKE_STRING("repos-root-url"), info_item_repos_root_url },
- { MAKE_STRING("repos-uuid"), info_item_repos_uuid },
- { MAKE_STRING("repos-size"), info_item_repos_size },
- { MAKE_STRING("revision"), info_item_revision },
- { MAKE_STRING("last-changed-revision"),
- info_item_last_changed_rev },
- { MAKE_STRING("last-changed-date"), info_item_last_changed_date },
- { MAKE_STRING("last-changed-author"), info_item_last_changed_author },
- { MAKE_STRING("wc-root"), info_item_wc_root },
- { MAKE_STRING("schedule"), info_item_schedule },
- { MAKE_STRING("depth"), info_item_depth },
- { MAKE_STRING("changelist"), info_item_changelist },
+ { SVN__STATIC_STRING("kind"), info_item_kind },
+ { SVN__STATIC_STRING("url"), info_item_url },
+ { SVN__STATIC_STRING("relative-url"), info_item_relative_url },
+ { SVN__STATIC_STRING("repos-root-url"), info_item_repos_root_url },
+ { SVN__STATIC_STRING("repos-uuid"), info_item_repos_uuid },
+ { SVN__STATIC_STRING("repos-size"), info_item_repos_size },
+ { SVN__STATIC_STRING("revision"), info_item_revision },
+ { SVN__STATIC_STRING("last-changed-revision"),
+ info_item_last_changed_rev },
+ { SVN__STATIC_STRING("last-changed-date"), info_item_last_changed_date },
+ { SVN__STATIC_STRING("last-changed-author"), info_item_last_changed_author },
+ { SVN__STATIC_STRING("wc-root"), info_item_wc_root },
+ { SVN__STATIC_STRING("schedule"), info_item_schedule },
+ { SVN__STATIC_STRING("depth"), info_item_depth },
+ { SVN__STATIC_STRING("changelist"), info_item_changelist },
};
-#undef MAKE_STRING
static const apr_size_t info_item_map_len =
(sizeof(info_item_map) / sizeof(info_item_map[0]));
Modified: subversion/trunk/subversion/tests/libsvn_diff/diff-diff3-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_diff/diff-diff3-test.c?rev=1896256&r1=1896255&r2=1896256&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_diff/diff-diff3-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_diff/diff-diff3-test.c Tue Dec 21 21:36:48 2021
@@ -28,6 +28,8 @@
#include "svn_pools.h"
#include "svn_utf.h"
+#include "private/svn_string_private.h"
+
/* Used to terminate lines in large multi-line string literals. */
#define NL APR_EOL_STR
@@ -2071,15 +2073,13 @@ test_three_way_merge_conflict_styles(apr
}
-#define MAKE_STRING(cstr) { (cstr), sizeof((cstr))-1 }
-
static svn_error_t *
test_diff4(apr_pool_t *pool)
{
svn_diff_t *diff;
svn_stream_t *actual, *expected;
svn_boolean_t same;
- static svn_string_t B2 = MAKE_STRING(
+ static svn_string_t B2 = SVN__STATIC_STRING(
"int main (int argc, char **argv)\n"
"{\n"
" /* line minus-five of context */\n"
@@ -2094,7 +2094,7 @@ test_diff4(apr_pool_t *pool)
" /* line plus-four of context */\n"
" /* line plus-five of context */\n"
"}\n");
- static svn_string_t B2new = MAKE_STRING(
+ static svn_string_t B2new = SVN__STATIC_STRING(
"int main (int argc, char **argv)\n"
"{\n"
" /* line minus-five of context */\n"
@@ -2109,7 +2109,7 @@ test_diff4(apr_pool_t *pool)
" /* line plus-four of context */\n"
" /* line plus-five of context */\n"
"}\n");
- static svn_string_t T1 = MAKE_STRING(
+ static svn_string_t T1 = SVN__STATIC_STRING(
"int main (int argc, char **argv)\n"
"{\n"
" /* line minus-five of context */\n"
@@ -2124,7 +2124,7 @@ test_diff4(apr_pool_t *pool)
" /* line plus-four of context */\n"
" /* line plus-five of context */\n"
"}\n");
- static svn_string_t T2 = MAKE_STRING(
+ static svn_string_t T2 = SVN__STATIC_STRING(
"#include <stdio.h>\n"
"\n"
"int main (int argc, char **argv)\n"
@@ -2141,7 +2141,7 @@ test_diff4(apr_pool_t *pool)
" /* line plus-four of context */\n"
" /* line plus-five of context */\n"
"}\n");
- static svn_string_t T3 = MAKE_STRING(
+ static svn_string_t T3 = SVN__STATIC_STRING(
"#include <stdio.h>\n"
"\n"
"int main (int argc, char **argv)\n"