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/02/25 16:37:26 UTC
svn commit: r1886924 - /subversion/trunk/subversion/libsvn_wc/workqueue.c
Author: kotkov
Date: Thu Feb 25 16:37:26 2021
New Revision: 1886924
URL: http://svn.apache.org/viewvc?rev=1886924&view=rev
Log:
Reorganize parts of workqueue.c to avoid having to use a forward declaration.
* subversion/libsvn_wc/workqueue.c
(work_item_baton_t): Declare and define this in one place.
(wq_record_fileinfo): Move the implementation of this helper to the top
of the file, remove the forward declaration.
Modified:
subversion/trunk/subversion/libsvn_wc/workqueue.c
Modified: subversion/trunk/subversion/libsvn_wc/workqueue.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/workqueue.c?rev=1886924&r1=1886923&r2=1886924&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/workqueue.c (original)
+++ subversion/trunk/subversion/libsvn_wc/workqueue.c Thu Feb 25 16:37:26 2021
@@ -66,7 +66,14 @@
/* For work queue debugging. Generates output about its operation. */
/* #define SVN_DEBUG_WORK_QUEUE */
-typedef struct work_item_baton_t work_item_baton_t;
+typedef struct work_item_baton_t
+{
+ apr_pool_t *result_pool; /* Pool to allocate result in */
+
+ svn_boolean_t used; /* needs reset */
+
+ apr_hash_t *record_map; /* const char * -> svn_wc__db_fileinfo_t map */
+} work_item_baton_t;
struct work_item_dispatch {
const char *name;
@@ -79,12 +86,26 @@ struct work_item_dispatch {
apr_pool_t *scratch_pool);
};
-/* Forward definition */
static void
wq_record_fileinfo(work_item_baton_t *wqb,
const char *local_abspath,
apr_time_t mtime,
- svn_filesize_t size);
+ svn_filesize_t size)
+{
+ svn_wc__db_fileinfo_t *info;
+
+ wqb->used = TRUE;
+
+ if (! wqb->record_map)
+ wqb->record_map = apr_hash_make(wqb->result_pool);
+
+ info = apr_pcalloc(wqb->result_pool, sizeof(*info));
+ info->mtime = mtime;
+ info->size = size;
+
+ svn_hash_sets(wqb->record_map, apr_pstrdup(wqb->result_pool, local_abspath),
+ info);
+}
/* ------------------------------------------------------------------------ */
/* OP_REMOVE_BASE */
@@ -1419,16 +1440,6 @@ static const struct work_item_dispatch d
{ NULL }
};
-struct work_item_baton_t
-{
- apr_pool_t *result_pool; /* Pool to allocate result in */
-
- svn_boolean_t used; /* needs reset */
-
- apr_hash_t *record_map; /* const char * -> svn_wc__db_fileinfo_t map */
-};
-
-
static svn_error_t *
dispatch_work_item(work_item_baton_t *wqb,
svn_wc__db_t *db,
@@ -1624,25 +1635,3 @@ svn_wc__wq_merge(svn_skel_t *work_item1,
svn_skel__append(work_item1, work_item2->children);
return work_item1;
}
-
-
-static void
-wq_record_fileinfo(work_item_baton_t *wqb,
- const char *local_abspath,
- apr_time_t mtime,
- svn_filesize_t size)
-{
- svn_wc__db_fileinfo_t *info;
-
- wqb->used = TRUE;
-
- if (! wqb->record_map)
- wqb->record_map = apr_hash_make(wqb->result_pool);
-
- info = apr_pcalloc(wqb->result_pool, sizeof(*info));
- info->mtime = mtime;
- info->size = size;
-
- svn_hash_sets(wqb->record_map, apr_pstrdup(wqb->result_pool, local_abspath),
- info);
-}