G/M,
On 14/11/2011 10:32 PM, Daniel Shahaf wrote:
On Monday, November 14, 2011 9:59 PM, "NormW"<no...@gknw.net> wrote:
G/E,
On 14/11/2011 5:26 PM, Daniel Shahaf wrote:
On Monday, November 14, 2011 8:27 AM, "NormW"<no...@gknw.net> wrote:
Hi,
Well, perhaps fix the compiler instead of rewriting everyone's switch
statements? :-)
A question to that effect was asked on the OWC developer site and the
reply suggested that adding 64-bit int switch support would be of such a
major effort this close to 2.0 (rumored March 2012) that it would not be
considered. Note that that question preceded this thread.
If the life of Subversion hung on need for 64-switch blocks, would
happily aim OWC at other tasks, but the one instance (for now anyway)
that can readily be replaced as shown adds yet another compiler (also
Open Source) to the potential build methods.
Sure. And if someone runs into it in the course of subversion
development (rather than OWC development), I'll happily commit the patch
that fixes it. Until then, I still think the compiler should be fixed;
trying to remove the switch() statement from C is going to be rather
Sisyphean.
Well clearly not _every_ switch as OWC does support up to 32-bit ints in
switch expressions. At the end of the day whether or not Subversion is
compilable with OWC is a decision of their respective 'owners' and at
worst this thread highlighted both the shortfalls and a work-around for
a major one, until one or the other give a(n) 25.4 millimetres.
Have attached a patch against trunk for the suggested switch{} change
but will leave the warnings (casts,pointers,etc) to experts.
In the event something bites off the patch a copy is given below.
Regards,
Norm
Index: subversion/libsvn_ra_svn/client.c
===================================================================
--- subversion/libsvn_ra_svn/client.c (revision 1202544)
+++ subversion/libsvn_ra_svn/client.c (working copy)
@@ -1166,15 +1166,12 @@
static svn_tristate_t
optbool_to_tristate(apr_uint64_t v)
{
- switch (v)
- {
- case TRUE:
- return svn_tristate_true;
- case FALSE:
- return svn_tristate_false;
- default: /* Contains SVN_RA_SVN_UNSPECIFIED_NUMBER */
- return svn_tristate_unknown;
- }
+ if (v == TRUE)
+ return svn_tristate_true;
+ if (v == FALSE)
+ return svn_tristate_false;
+
+ return svn_tristate_unknown; /* Contains SVN_RA_SVN_UNSPECIFIED_NUMBER */
}
/* If REVISION is SVN_INVALID_REVNUM, no value is sent to the
Index: subversion/libsvn_ra_svn/client.c
===================================================================
--- subversion/libsvn_ra_svn/client.c (revision 1202544)
+++ subversion/libsvn_ra_svn/client.c (working copy)
@@ -1166,15 +1166,12 @@
static svn_tristate_t
optbool_to_tristate(apr_uint64_t v)
{
- switch (v)
- {
- case TRUE:
- return svn_tristate_true;
- case FALSE:
- return svn_tristate_false;
- default: /* Contains SVN_RA_SVN_UNSPECIFIED_NUMBER */
- return svn_tristate_unknown;
- }
+ if (v == TRUE)
+ return svn_tristate_true;
+ if (v == FALSE)
+ return svn_tristate_false;
+
+ return svn_tristate_unknown; /* Contains SVN_RA_SVN_UNSPECIFIED_NUMBER */
}
/* If REVISION is SVN_INVALID_REVNUM, no value is sent to the