subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1498858 - in /subversion/trunk/subversion/libsvn_ra_serf: blame.c get_deleted_rev.c getdate.c getlocations.c getlocationsegments.c getlocks.c inherited_props.c log.c merge.c mergeinfo.c options.c property.c ra_serf.h update.c xml.c
Date Tue, 02 Jul 2013 09:41:35 GMT
Author: rhuijben
Date: Tue Jul  2 09:41:34 2013
New Revision: 1498858

URL: http://svn.apache.org/r1498858
Log:
Use macro for the initial state in serf's transition based xml parser,
instead of just 0.

Suggested by: gstein

* subversion/libsvn_ra_serf/ra_serf.h
  (XML_STATE_INITIAL): New macro.
  (svn_ra_serf__xml_transition_t): Update documentation.

* subversion/libsvn_ra_serf/blame.c
  (blame_state_e):

* subversion/libsvn_ra_serf/getdate.c
  (date_state_e):

* subversion/libsvn_ra_serf/getlocations.c
  (loc_state_e):

* subversion/libsvn_ra_serf/getlocationsegments.c
  (locseg_state_e):

* subversion/libsvn_ra_serf/getlocks.c
  (getlocks_state_e):

* subversion/libsvn_ra_serf/get_deleted_rev.c
  (drev_state_e):

* subversion/libsvn_ra_serf/inherited_props.c
  (iprops_state_e):

* subversion/libsvn_ra_serf/log.c
  (log_state_e):

* subversion/libsvn_ra_serf/merge.c
  (merge_state_e):

* subversion/libsvn_ra_serf/mergeinfo.c
  (mergeinfo_state_e):

* subversion/libsvn_ra_serf/options.c
  (options_state_e):

* subversion/libsvn_ra_serf/property.c
  (prop_state_e):

* subversion/libsvn_ra_serf/update.c
  (report_state_e):

* subversion/libsvn_ra_serf/xml.c
  (svn_ra_serf__xml_cb_start): Replace usage 0 with XML_STATE_INITIAL.
    Name enums when not already named.

Modified:
    subversion/trunk/subversion/libsvn_ra_serf/blame.c
    subversion/trunk/subversion/libsvn_ra_serf/get_deleted_rev.c
    subversion/trunk/subversion/libsvn_ra_serf/getdate.c
    subversion/trunk/subversion/libsvn_ra_serf/getlocations.c
    subversion/trunk/subversion/libsvn_ra_serf/getlocationsegments.c
    subversion/trunk/subversion/libsvn_ra_serf/getlocks.c
    subversion/trunk/subversion/libsvn_ra_serf/inherited_props.c
    subversion/trunk/subversion/libsvn_ra_serf/log.c
    subversion/trunk/subversion/libsvn_ra_serf/merge.c
    subversion/trunk/subversion/libsvn_ra_serf/mergeinfo.c
    subversion/trunk/subversion/libsvn_ra_serf/options.c
    subversion/trunk/subversion/libsvn_ra_serf/property.c
    subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h
    subversion/trunk/subversion/libsvn_ra_serf/update.c
    subversion/trunk/subversion/libsvn_ra_serf/xml.c

Modified: subversion/trunk/subversion/libsvn_ra_serf/blame.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/blame.c?rev=1498858&r1=1498857&r2=1498858&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/blame.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/blame.c Tue Jul  2 09:41:34 2013
@@ -47,7 +47,7 @@
  * This enum represents the current state of our XML parsing for a REPORT.
  */
 typedef enum blame_state_e {
-  INITIAL = 0,
+  INITIAL = XML_STATE_INITIAL,
   FILE_REVS_REPORT,
   FILE_REV,
   REV_PROP,

Modified: subversion/trunk/subversion/libsvn_ra_serf/get_deleted_rev.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/get_deleted_rev.c?rev=1498858&r1=1498857&r2=1498858&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/get_deleted_rev.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/get_deleted_rev.c Tue Jul  2 09:41:34 2013
@@ -36,7 +36,7 @@
  * This enum represents the current state of our XML parsing for a REPORT.
  */
 enum drev_state_e {
-  INITIAL = 0,
+  INITIAL = XML_STATE_INITIAL,
   REPORT,
   VERSION_NAME
 };

Modified: subversion/trunk/subversion/libsvn_ra_serf/getdate.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/getdate.c?rev=1498858&r1=1498857&r2=1498858&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/getdate.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/getdate.c Tue Jul  2 09:41:34 2013
@@ -44,7 +44,7 @@
  * This enum represents the current state of our XML parsing for a REPORT.
  */
 enum date_state_e {
-  INITIAL = 0,
+  INITIAL = XML_STATE_INITIAL,
   REPORT,
   VERSION_NAME
 };

Modified: subversion/trunk/subversion/libsvn_ra_serf/getlocations.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/getlocations.c?rev=1498858&r1=1498857&r2=1498858&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/getlocations.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/getlocations.c Tue Jul  2 09:41:34 2013
@@ -43,7 +43,7 @@
  * This enum represents the current state of our XML parsing for a REPORT.
  */
 enum loc_state_e {
-  INITIAL = 0,
+  INITIAL = XML_STATE_INITIAL,
   REPORT,
   LOCATION
 };

Modified: subversion/trunk/subversion/libsvn_ra_serf/getlocationsegments.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/getlocationsegments.c?rev=1498858&r1=1498857&r2=1498858&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/getlocationsegments.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/getlocationsegments.c Tue Jul  2 09:41:34 2013
@@ -52,8 +52,8 @@ typedef struct gls_context_t {
 
 } gls_context_t;
 
-enum {
-  INITIAL = 0,
+enum locseg_state_e {
+  INITIAL = XML_STATE_INITIAL,
   REPORT,
   SEGMENT
 };

Modified: subversion/trunk/subversion/libsvn_ra_serf/getlocks.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/getlocks.c?rev=1498858&r1=1498857&r2=1498858&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/getlocks.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/getlocks.c Tue Jul  2 09:41:34 2013
@@ -47,8 +47,8 @@
 /*
  * This enum represents the current state of our XML parsing for a REPORT.
  */
-enum {
-  INITIAL = 0,
+enum getlocks_state_e {
+  INITIAL = XML_STATE_INITIAL,
   REPORT,
   LOCK,
   PATH,

Modified: subversion/trunk/subversion/libsvn_ra_serf/inherited_props.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/inherited_props.c?rev=1498858&r1=1498857&r2=1498858&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/inherited_props.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/inherited_props.c Tue Jul  2 09:41:34 2013
@@ -41,7 +41,7 @@
 
 /* The current state of our XML parsing. */
 typedef enum iprops_state_e {
-  INITIAL = 0,
+  INITIAL = XML_STATE_INITIAL,
   IPROPS_REPORT,
   IPROPS_ITEM,
   IPROPS_PATH,

Modified: subversion/trunk/subversion/libsvn_ra_serf/log.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/log.c?rev=1498858&r1=1498857&r2=1498858&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/log.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/log.c Tue Jul  2 09:41:34 2013
@@ -48,8 +48,8 @@
 /*
  * This enum represents the current state of our XML parsing for a REPORT.
  */
-enum {
-  INITIAL = 0,
+enum log_state_e {
+  INITIAL = XML_STATE_INITIAL,
   REPORT,
   ITEM,
   VERSION,

Modified: subversion/trunk/subversion/libsvn_ra_serf/merge.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/merge.c?rev=1498858&r1=1498857&r2=1498858&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/merge.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/merge.c Tue Jul  2 09:41:34 2013
@@ -48,7 +48,7 @@
  * This enum represents the current state of our XML parsing for a MERGE.
  */
 typedef enum merge_state_e {
-  INITIAL = 0,
+  INITIAL = XML_STATE_INITIAL,
   MERGE_RESPONSE,
   UPDATED_SET,
   RESPONSE,

Modified: subversion/trunk/subversion/libsvn_ra_serf/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/mergeinfo.c?rev=1498858&r1=1498857&r2=1498858&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/mergeinfo.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/mergeinfo.c Tue Jul  2 09:41:34 2013
@@ -41,7 +41,7 @@
 
 /* The current state of our XML parsing. */
 typedef enum mergeinfo_state_e {
-  INITIAL = 0,
+  INITIAL = XML_STATE_INITIAL,
   MERGEINFO_REPORT,
   MERGEINFO_ITEM,
   MERGEINFO_PATH,

Modified: subversion/trunk/subversion/libsvn_ra_serf/options.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/options.c?rev=1498858&r1=1498857&r2=1498858&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/options.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/options.c Tue Jul  2 09:41:34 2013
@@ -50,7 +50,7 @@
  * This enum represents the current state of our XML parsing for an OPTIONS.
  */
 enum options_state_e {
-  INITIAL = 0,
+  INITIAL = XML_STATE_INITIAL,
   OPTIONS,
   ACTIVITY_COLLECTION,
   HREF

Modified: subversion/trunk/subversion/libsvn_ra_serf/property.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/property.c?rev=1498858&r1=1498857&r2=1498858&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/property.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/property.c Tue Jul  2 09:41:34 2013
@@ -42,7 +42,7 @@
 
 /* Our current parsing state we're in for the PROPFIND response. */
 typedef enum prop_state_e {
-  INITIAL = 0,
+  INITIAL = XML_STATE_INITIAL,
   MULTISTATUS,
   RESPONSE,
   HREF,

Modified: subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h?rev=1498858&r1=1498857&r2=1498858&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h Tue Jul  2 09:41:34 2013
@@ -731,6 +731,10 @@ typedef svn_error_t *
                             apr_pool_t *scratch_pool);
 
 
+/* Magic state value for the initial state in a svn_ra_serf__xml_transition_t
+   table */
+#define XML_STATE_INITIAL 0
+
 /* State transition table.
 
    When the XML Context is constructed, it is in state 0. User states are
@@ -739,6 +743,8 @@ typedef svn_error_t *
    In a list of transitions, use { 0 } to indicate the end. Specifically,
    the code looks for NS == NULL.
 
+   The initial state for each transition table is XML_STATE_INITIAL.
+
    ### more docco
 */
 typedef struct svn_ra_serf__xml_transition_t {

Modified: subversion/trunk/subversion/libsvn_ra_serf/update.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/update.c?rev=1498858&r1=1498857&r2=1498858&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/update.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/update.c Tue Jul  2 09:41:34 2013
@@ -64,7 +64,7 @@
  */
 typedef enum report_state_e {
     NONE = 0,
-    INITIAL = 0,
+    INITIAL = XML_STATE_INITIAL /* = 0 */,
     UPDATE_REPORT,
     TARGET_REVISION,
     OPEN_DIR,

Modified: subversion/trunk/subversion/libsvn_ra_serf/xml.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/xml.c?rev=1498858&r1=1498857&r2=1498858&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/xml.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/xml.c Tue Jul  2 09:41:34 2013
@@ -615,7 +615,7 @@ svn_ra_serf__xml_cb_start(svn_ra_serf__x
     }
   if (scan->ns == NULL)
     {
-      if (current->state == 0)
+      if (current->state == XML_STATE_INITIAL)
         {
           return svn_error_createf(
                         SVN_ERR_RA_DAV_MALFORMED_DATA, NULL,



Mime
View raw message