Login | Register
My pages Projects Community openCollabNet

Discussions > commits > svn commit: r2474 - branches/fsvs-1.2.x/fsvs: . src

fsvs
Discussion topic

Back to topic list

svn commit: r2474 - branches/fsvs-1.2.x/fsvs: . src

Author pmarek
Full name P.Marek
Date 2015-07-26 22:47:43 PDT
Message Author: pmarek
Date: 2015-07-26 22:47:43-0700
New Revision: 2474

Modified:
   branches/fsvs-1.2.x/​fsvs/CHANGES
   branches/fsvs-1.2.x/​fsvs/src/commit.c
   branches/fsvs-1.2.x/​fsvs/src/helper.c
   branches/fsvs-1.2.x/​fsvs/src/helper.h
   branches/fsvs-1.2.x/​fsvs/src/log.c
   branches/fsvs-1.2.x/​fsvs/src/props.c
   branches/fsvs-1.2.x/​fsvs/src/props.h
   branches/fsvs-1.2.x/​fsvs/src/racallback.​c
   branches/fsvs-1.2.x/​fsvs/src/status.c
   branches/fsvs-1.2.x/​fsvs/src/waa.c
   branches/fsvs-1.2.x/​fsvs/src/waa.h

Log:
Some fixes for compilation via clang.

See http://fsvs.tigris.o​rg/issues/show_bug.c​gi?id=19



Modified: branches/fsvs-1.2.x/​fsvs/CHANGES
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/branches/fsvs-1.2.​x/fsvs/CHANGES?view=​diff&pathrev=247​4&r1=2473&r2​=2474
====================​====================​====================​==================
--- branches/fsvs-1.2.x/​fsvs/CHANGES (original)
+++ branches/fsvs-1.2.x/​fsvs/CHANGES 2015-07-26 22:47:43-0700
@@ -1,5 +1,6 @@
 Changes since 1.2.6
 - Updates for GCC 5
+- Updates for Clang
 
 Changes since 1.2.5
 - Fix for segfault on deleted properties, eg. "svn:owner".

Modified: branches/fsvs-1.2.x/​fsvs/src/commit.c
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/branches/fsvs-1.2.​x/fsvs/src/commit.c?​view=diff&pathre​v=2474&r1=2473​&r2=2474
====================​====================​====================​==================
--- branches/fsvs-1.2.x/​fsvs/src/commit.c (original)
+++ branches/fsvs-1.2.x/​fsvs/src/commit.c 2015-07-26 22:47:43-0700
@@ -1,5 +1,5 @@
 /*******************​********************​********************​*************
- * Copyright (C) 2005-2009 Philipp Marek.
+ * Copyright (C) 2005-2009,2015 Philipp Marek.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 3 as
@@ -241,7 +241,8 @@
 
 /* Convenience function; checks for \c FSVS_PROP_COMMIT_PIPE.
  * By putting that here we can avoid sending most of the parameters. */
-inline int send_a_prop(void *baton, int store_encoder,
+// inline
+int send_a_prop(void *baton, int store_encoder,
         struct estat *sts, change_any_prop_t function,
         char *key, svn_string_t *value,
         apr_pool_t *pool)

Modified: branches/fsvs-1.2.x/​fsvs/src/helper.c
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/branches/fsvs-1.2.​x/fsvs/src/helper.c?​view=diff&pathre​v=2474&r1=2473​&r2=2474
====================​====================​====================​==================
--- branches/fsvs-1.2.x/​fsvs/src/helper.c (original)
+++ branches/fsvs-1.2.x/​fsvs/src/helper.c 2015-07-26 22:47:43-0700
@@ -1,5 +1,5 @@
 /*******************​********************​********************​*************
- * Copyright (C) 2005-2009 Philipp Marek.
+ * Copyright (C) 2005-2009,2015 Philipp Marek.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 3 as
@@ -1582,6 +1582,7 @@
 
 
     status=0;
+ path=NULL;
     switch (opt__get_int(OPT__PATH))
     {
         case PATH_WCRELATIVE:
@@ -1958,7 +1959,7 @@
 /** -.
  * If \a source is not \c NULL \a len bytes are copied.
  * The buffer is \b always \c \\0 terminated. */
-int hlp__strnalloc(int len, char **dest, const char const *source)
+int hlp__strnalloc(int len, char **dest, const char * const source)
 {
     int status;
 
@@ -1974,7 +1975,7 @@
 
 /** -. */
 int hlp__strmnalloc(int len, char **dest,
- const char const *source, ...)
+ const char * source, ...)
 {
     int status;
     va_list vl;

Modified: branches/fsvs-1.2.x/​fsvs/src/helper.h
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/branches/fsvs-1.2.​x/fsvs/src/helper.h?​view=diff&pathre​v=2474&r1=2473​&r2=2474
====================​====================​====================​==================
--- branches/fsvs-1.2.x/​fsvs/src/helper.h (original)
+++ branches/fsvs-1.2.x/​fsvs/src/helper.h 2015-07-26 22:47:43-0700
@@ -1,5 +1,5 @@
 /*******************​********************​********************​*************
- * Copyright (C) 2005-2009 Philipp Marek.
+ * Copyright (C) 2005-2009,2015 Philipp Marek.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 3 as
@@ -181,13 +181,13 @@
  * and so I'd have to use casts everywhere, which wouldn't help the
  * type-safety anyway. */
 /** Allocates a buffer in \a *dest, and copies \a source. */
-int hlp__strnalloc(int len, char **dest, const char const *source);
+int hlp__strnalloc(int len, char **dest, const char * const source);
 /** Like \c hlp__strnalloc, but concatenates strings until a \c NULL is
  * found. */
 int hlp__strmnalloc(int len, char **dest,
- const char const *source, ...) __attribute__((sentinel));
+ const char * source, ...) __attribute__((sentinel));
 /** Own implementation of \c strdup(), possibly returning \c ENOMEM. */
-inline static int hlp__strdup(char **dest, const char const *src)
+inline static int hlp__strdup(char **dest, const char * const src)
 { return hlp__strnalloc(strlen(src), dest, src); }
 /** Error returning \c calloc(); uses \c (void**) \a output. */
 int hlp__calloc(void *output, size_t nmemb, size_t count);

Modified: branches/fsvs-1.2.x/​fsvs/src/log.c
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/branches/fsvs-1.2.​x/fsvs/src/log.c?vie​w=diff&pathrev=2​474&r1=2473&​r2=2474
====================​====================​====================​==================
--- branches/fsvs-1.2.x/​fsvs/src/log.c (original)
+++ branches/fsvs-1.2.x/​fsvs/src/log.c 2015-07-26 22:47:43-0700
@@ -1,5 +1,5 @@
 /*******************​********************​********************​*************
- * Copyright (C) 2007-2009 Philipp Marek.
+ * Copyright (C) 2007-2009,2015 Philipp Marek.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 3 as
@@ -404,7 +404,7 @@
         case 2:
             opt__set_int(OPT__LOG_MAXREV,
                     PRIO_DEFAULT,
- abs(opt_target_revis​ion-opt_target_revis​ion2)+1);
+ labs(opt_target_revi​sion-opt_target_revi​sion2)+1);
             break;
         default:
             BUG("how many");

Modified: branches/fsvs-1.2.x/​fsvs/src/props.c
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/branches/fsvs-1.2.​x/fsvs/src/props.c?v​iew=diff&pathrev​=2474&r1=2473​&r2=2474
====================​====================​====================​==================
--- branches/fsvs-1.2.x/​fsvs/src/props.c (original)
+++ branches/fsvs-1.2.x/​fsvs/src/props.c 2015-07-26 22:47:43-0700
@@ -1,5 +1,5 @@
 /*******************​********************​********************​*************
- * Copyright (C) 2007-2009 Philipp Marek.
+ * Copyright (C) 2007-2009,2015 Philipp Marek.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 3 as
@@ -442,7 +442,7 @@
 
 /** -.
  * Wrapper for prp__fetch(). */
-int prp__get(hash_t db, const char *keycp, datum *value)
+int prp__get(hash_t db, char * const keycp, datum *value)
 {
   static datum key;
 
@@ -567,6 +567,7 @@
     char **normalized;
 
 
+ db=NULL;
     status=0;
     output=stdout;
     if (argc<2) ac__Usage_this();
@@ -636,6 +637,7 @@
 
 
     status=0;
+ db=NULL;
     if (argc<2) ac__Usage_this();
 
     /* Check name for special values. */
@@ -893,6 +895,7 @@
     int status, rv;
     datum key;
 
+ status=0;
     rv = prp__open_byestat( sts, GDBM_READER, &db);
     if (rv == ENOENT)
         goto done;

Modified: branches/fsvs-1.2.x/​fsvs/src/props.h
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/branches/fsvs-1.2.​x/fsvs/src/props.h?v​iew=diff&pathrev​=2474&r1=2473​&r2=2474
====================​====================​====================​==================
--- branches/fsvs-1.2.x/​fsvs/src/props.h (original)
+++ branches/fsvs-1.2.x/​fsvs/src/props.h 2015-07-26 22:47:43-0700
@@ -63,7 +63,7 @@
         hash_t *db);
 /** Get a value, addressed by a string; key length is calculated inclusive
  * the \c \\0. */
-int prp__get(hash_t db, const char *keycp, datum *value);
+int prp__get(hash_t db, char * const keycp, datum *value);
 /** Store the value; basic function. */
 int prp__store(hash_t db, datum key, datum value);
 /** Get first key. */

Modified: branches/fsvs-1.2.x/​fsvs/src/racallback.​c
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/branches/fsvs-1.2.​x/fsvs/src/racallbac​k.c?view=diff&pa​threv=2474&r1=24​73&r2=2474
====================​====================​====================​==================
--- branches/fsvs-1.2.x/​fsvs/src/racallback.​c (original)
+++ branches/fsvs-1.2.x/​fsvs/src/racallback.​c 2015-07-26 22:47:43-0700
@@ -1,5 +1,5 @@
 /*******************​********************​********************​*************
- * Copyright (C) 2005-2009 Philipp Marek.
+ * Copyright (C) 2005-2009,2015 Philipp Marek.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 3 as
@@ -293,7 +293,8 @@
 }
 
 
-inline int cb___store_prop(struct estat *sts,
+// inline
+int cb___store_prop(struct estat *sts,
         const char *utf8_name, const svn_string_t *value,
         apr_pool_t *pool)
 {

Modified: branches/fsvs-1.2.x/​fsvs/src/status.c
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/branches/fsvs-1.2.​x/fsvs/src/status.c?​view=diff&pathre​v=2474&r1=2473​&r2=2474
====================​====================​====================​==================
--- branches/fsvs-1.2.x/​fsvs/src/status.c (original)
+++ branches/fsvs-1.2.x/​fsvs/src/status.c 2015-07-26 22:47:43-0700
@@ -134,29 +134,29 @@
 
 
 /** Meta-data status string. */
-inline char * st___meta_string(int status_bits, int flags)
+char * st___meta_string(int status_bits, int flags)
 {
- static char buffer[4];
- int prop;
+ static char buffer[4];
+ int prop;
 
- prop=(status_bits & FS_PROPERTIES) | (flags & RF_PUSHPROPS);
+ prop=(status_bits & FS_PROPERTIES) | (flags & RF_PUSHPROPS);
 
- if (opt__is_verbose() > 0)
- {
- buffer[0] = status_bits & FS_META_MTIME ? 't' : '.';
- buffer[1] = status_bits &
- (FS_META_OWNER | FS_META_GROUP | FS_META_UMODE) ? 'p' : '.';
- buffer[2] = prop ? 'P' : '.';
- buffer[3] = 0;
- }
- else
- {
- buffer[0] = status_bits & FS_META_CHANGED ? 'm' :
- prop ? 'P' : '.';
- buffer[1]=0;
- }
+ if (opt__is_verbose() > 0)
+ {
+ buffer[0] = status_bits & FS_META_MTIME ? 't' : '.';
+ buffer[1] = status_bits &
+ (FS_META_OWNER | FS_META_GROUP | FS_META_UMODE) ? 'p' : '.';
+ buffer[2] = prop ? 'P' : '.';
+ buffer[3] = 0;
+ }
+ else
+ {
+ buffer[0] = status_bits & FS_META_CHANGED ? 'm' :
+ prop ? 'P' : '.';
+ buffer[1]=0;
+ }
 
- return buffer;
+ return buffer;
 }
 
 

Modified: branches/fsvs-1.2.x/​fsvs/src/waa.c
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/branches/fsvs-1.2.​x/fsvs/src/waa.c?vie​w=diff&pathrev=2​474&r1=2473&​r2=2474
====================​====================​====================​==================
--- branches/fsvs-1.2.x/​fsvs/src/waa.c (original)
+++ branches/fsvs-1.2.x/​fsvs/src/waa.c 2015-07-26 22:47:43-0700
@@ -1,5 +1,5 @@
 /*******************​********************​********************​*************
- * Copyright (C) 2005-2009 Philipp Marek.
+ * Copyright (C) 2005-2009,2015 Philipp Marek.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 3 as
@@ -378,7 +378,7 @@
 
 
 /** Returns the MD5 of the given path, taking the softroot into account. */
-int waa___get_path_md5(const char const *path,
+int waa___get_path_md5(const char * path,
         unsigned char digest[APR_MD5_DIGESTSIZE])
 {
     int status;
@@ -769,11 +769,7 @@
         "\t";
     static const char readme_2[]="\n";
 
- inline int w(const char *buffer, int l)
- {
- return write(hdl, buffer, l) != l;
- }
-
+#define w(_buffer, _l) (write(hdl, _buffer, _l) != _l)
 
     STOPIF( waa__open(directory, name, O_CREAT | O_WRONLY, &hdl), NULL);
     STOPIF_CODE_ERR(
@@ -784,6 +780,8 @@
             "Cannot create the readme file.");
     STOPIF( waa__close(hdl, 0), NULL);
 
+#undef w
+
 ex:
     return status;
 }
@@ -3005,7 +3003,7 @@
 /** -.
  * The \a dir must be absolute; this function makes an own copy, so the
  * value will be unchanged. */
-int waa__set_working_copy(const char const *wc_dir)
+int waa__set_working_copy(const char * const wc_dir)
 {
     int status;
 
@@ -3022,7 +3020,7 @@
 /** -.
  * The \a dir must be absolute; this function makes an own copy, so the
  * value will be unchanged. */
-int waa__create_working_copy(const char const *wc_dir)
+int waa__create_working_copy(const char * const wc_dir)
 {
     int status;
     char *dir;

Modified: branches/fsvs-1.2.x/​fsvs/src/waa.h
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/branches/fsvs-1.2.​x/fsvs/src/waa.h?vie​w=diff&pathrev=2​474&r1=2473&​r2=2474
====================​====================​====================​==================
--- branches/fsvs-1.2.x/​fsvs/src/waa.h (original)
+++ branches/fsvs-1.2.x/​fsvs/src/waa.h 2015-07-26 22:47:43-0700
@@ -1,5 +1,5 @@
 /*******************​********************​********************​*************
- * Copyright (C) 2005-2009 Philipp Marek.
+ * Copyright (C) 2005-2009,2015 Philipp Marek.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 3 as
@@ -283,10 +283,10 @@
 int waa__find_base(struct estat *root, int *argc, char ***args);
 
 /** Creates the WAA and CONF directories needed for \a wc_path. */
-int waa__create_working_copy(const char const *wc_dir);
+int waa__create_working_copy(const char * const wc_dir);
 /** Stores the path of the working copy.
  * Not needed if waa__find_common_base or similar is called. */
-int waa__set_working_copy(const char const *wc_dir);
+int waa__set_working_copy(const char * const wc_dir);
 
 
 /** \name Building paths for FSVS's datafiles.

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

svn commit: r2474 - branches/fsvs-1.2.x/fsvs: . src pmarek P.Marek 2015-07-26 22:47:43 PDT
Messages per page: