Fossil SCM

More style fixes, e.g. c/char const/const char/

jan.nijtmans 2014-08-15 09:24 trunk
Commit 38421a9c998347c4d3f821ae90a94e2a21e11a73
+2 -2
--- src/browse.c
+++ src/browse.c
@@ -732,11 +732,11 @@
732732
** temporary table named "fileage" that contains the file-id for each
733733
** files, the pathname, the check-in where the file was added, and the
734734
** mtime on that checkin. If zGlob and *zGlob then only files matching
735735
** the given glob are computed.
736736
*/
737
-int compute_fileage(int vid, char const * zGlob){
737
+int compute_fileage(int vid, const char* zGlob){
738738
Manifest *pManifest;
739739
ManifestFile *pFile;
740740
int nFile = 0;
741741
double vmtime;
742742
Stmt ins;
@@ -815,11 +815,11 @@
815815
*/
816816
void fileage_page(void){
817817
int rid;
818818
const char *zName;
819819
char *zBaseTime;
820
- char const * zGlob;
820
+ const char *zGlob;
821821
Stmt q;
822822
double baseTime;
823823
int lastMid = -1;
824824
login_check_credentials();
825825
if( !g.perm.Read ){ login_needed(); return; }
826826
--- src/browse.c
+++ src/browse.c
@@ -732,11 +732,11 @@
732 ** temporary table named "fileage" that contains the file-id for each
733 ** files, the pathname, the check-in where the file was added, and the
734 ** mtime on that checkin. If zGlob and *zGlob then only files matching
735 ** the given glob are computed.
736 */
737 int compute_fileage(int vid, char const * zGlob){
738 Manifest *pManifest;
739 ManifestFile *pFile;
740 int nFile = 0;
741 double vmtime;
742 Stmt ins;
@@ -815,11 +815,11 @@
815 */
816 void fileage_page(void){
817 int rid;
818 const char *zName;
819 char *zBaseTime;
820 char const * zGlob;
821 Stmt q;
822 double baseTime;
823 int lastMid = -1;
824 login_check_credentials();
825 if( !g.perm.Read ){ login_needed(); return; }
826
--- src/browse.c
+++ src/browse.c
@@ -732,11 +732,11 @@
732 ** temporary table named "fileage" that contains the file-id for each
733 ** files, the pathname, the check-in where the file was added, and the
734 ** mtime on that checkin. If zGlob and *zGlob then only files matching
735 ** the given glob are computed.
736 */
737 int compute_fileage(int vid, const char* zGlob){
738 Manifest *pManifest;
739 ManifestFile *pFile;
740 int nFile = 0;
741 double vmtime;
742 Stmt ins;
@@ -815,11 +815,11 @@
815 */
816 void fileage_page(void){
817 int rid;
818 const char *zName;
819 char *zBaseTime;
820 const char *zGlob;
821 Stmt q;
822 double baseTime;
823 int lastMid = -1;
824 login_check_credentials();
825 if( !g.perm.Read ){ login_needed(); return; }
826
+1 -1
--- src/captcha.c
+++ src/captcha.c
@@ -448,11 +448,11 @@
448448
/*
449449
** Translate a captcha seed value into the captcha password string.
450450
** The returned string is static and overwritten on each call to
451451
** this function.
452452
*/
453
-char const *captcha_decode(unsigned int seed){
453
+const char *captcha_decode(unsigned int seed){
454454
const char *zSecret;
455455
const char *z;
456456
Blob b;
457457
static char zRes[20];
458458
459459
--- src/captcha.c
+++ src/captcha.c
@@ -448,11 +448,11 @@
448 /*
449 ** Translate a captcha seed value into the captcha password string.
450 ** The returned string is static and overwritten on each call to
451 ** this function.
452 */
453 char const *captcha_decode(unsigned int seed){
454 const char *zSecret;
455 const char *z;
456 Blob b;
457 static char zRes[20];
458
459
--- src/captcha.c
+++ src/captcha.c
@@ -448,11 +448,11 @@
448 /*
449 ** Translate a captcha seed value into the captcha password string.
450 ** The returned string is static and overwritten on each call to
451 ** this function.
452 */
453 const char *captcha_decode(unsigned int seed){
454 const char *zSecret;
455 const char *z;
456 Blob b;
457 static char zRes[20];
458
459
+2 -2
--- src/import.c
+++ src/import.c
@@ -214,12 +214,12 @@
214214
215215
/*
216216
** Compare two strings for sorting.
217217
*/
218218
static int string_cmp(const void *pLeft, const void *pRight){
219
- const char *zLeft = *(char const **)pLeft;
220
- const char *zRight = *(char const **)pRight;
219
+ const char *zLeft = *(const char **)pLeft;
220
+ const char *zRight = *(const char **)pRight;
221221
return fossil_strcmp(zLeft, zRight);
222222
}
223223
224224
/* Forward reference */
225225
static void import_prior_files(void);
226226
--- src/import.c
+++ src/import.c
@@ -214,12 +214,12 @@
214
215 /*
216 ** Compare two strings for sorting.
217 */
218 static int string_cmp(const void *pLeft, const void *pRight){
219 const char *zLeft = *(char const **)pLeft;
220 const char *zRight = *(char const **)pRight;
221 return fossil_strcmp(zLeft, zRight);
222 }
223
224 /* Forward reference */
225 static void import_prior_files(void);
226
--- src/import.c
+++ src/import.c
@@ -214,12 +214,12 @@
214
215 /*
216 ** Compare two strings for sorting.
217 */
218 static int string_cmp(const void *pLeft, const void *pRight){
219 const char *zLeft = *(const char **)pLeft;
220 const char *zRight = *(const char **)pRight;
221 return fossil_strcmp(zLeft, zRight);
222 }
223
224 /* Forward reference */
225 static void import_prior_files(void);
226
+2 -2
--- src/manifest.c
+++ src/manifest.c
@@ -1920,12 +1920,12 @@
19201920
db_multi_exec("INSERT OR IGNORE INTO pending_tkt VALUES(%Q)",
19211921
p->zTicketUuid);
19221922
}
19231923
if( p->type==CFTYPE_ATTACHMENT ){
19241924
char *zComment = 0;
1925
- char const isAdd = (p->zAttachSrc && p->zAttachSrc[0]) ? 1 : 0;
1926
- char const attachToType = fossil_is_uuid(p->zAttachTarget)
1925
+ const char isAdd = (p->zAttachSrc && p->zAttachSrc[0]) ? 1 : 0;
1926
+ const char attachToType = fossil_is_uuid(p->zAttachTarget)
19271927
? 't' /* attach to ticket */
19281928
: 'w' /* attach to wiki page */;
19291929
db_multi_exec(
19301930
"INSERT INTO attachment(attachid, mtime, src, target,"
19311931
"filename, comment, user)"
19321932
--- src/manifest.c
+++ src/manifest.c
@@ -1920,12 +1920,12 @@
1920 db_multi_exec("INSERT OR IGNORE INTO pending_tkt VALUES(%Q)",
1921 p->zTicketUuid);
1922 }
1923 if( p->type==CFTYPE_ATTACHMENT ){
1924 char *zComment = 0;
1925 char const isAdd = (p->zAttachSrc && p->zAttachSrc[0]) ? 1 : 0;
1926 char const attachToType = fossil_is_uuid(p->zAttachTarget)
1927 ? 't' /* attach to ticket */
1928 : 'w' /* attach to wiki page */;
1929 db_multi_exec(
1930 "INSERT INTO attachment(attachid, mtime, src, target,"
1931 "filename, comment, user)"
1932
--- src/manifest.c
+++ src/manifest.c
@@ -1920,12 +1920,12 @@
1920 db_multi_exec("INSERT OR IGNORE INTO pending_tkt VALUES(%Q)",
1921 p->zTicketUuid);
1922 }
1923 if( p->type==CFTYPE_ATTACHMENT ){
1924 char *zComment = 0;
1925 const char isAdd = (p->zAttachSrc && p->zAttachSrc[0]) ? 1 : 0;
1926 const char attachToType = fossil_is_uuid(p->zAttachTarget)
1927 ? 't' /* attach to ticket */
1928 : 'w' /* attach to wiki page */;
1929 db_multi_exec(
1930 "INSERT INTO attachment(attachid, mtime, src, target,"
1931 "filename, comment, user)"
1932
+1 -1
--- src/name.c
+++ src/name.c
@@ -309,11 +309,11 @@
309309
** zName does not resolve, 0 is returned. If it is ambiguous, a
310310
** negative value is returned. On success the rid is returned and
311311
** pUuid (if it is not NULL) is set to the a newly-allocated string,
312312
** the full UUID, which must eventually be free()d by the caller.
313313
*/
314
-int name_to_uuid2(char const *zName, const char *zType, char **pUuid){
314
+int name_to_uuid2(const char *zName, const char *zType, char **pUuid){
315315
int rid = symbolic_name_to_rid(zName, zType);
316316
if((rid>0) && pUuid){
317317
*pUuid = db_text(NULL, "SELECT uuid FROM blob WHERE rid=%d", rid);
318318
}
319319
return rid;
320320
--- src/name.c
+++ src/name.c
@@ -309,11 +309,11 @@
309 ** zName does not resolve, 0 is returned. If it is ambiguous, a
310 ** negative value is returned. On success the rid is returned and
311 ** pUuid (if it is not NULL) is set to the a newly-allocated string,
312 ** the full UUID, which must eventually be free()d by the caller.
313 */
314 int name_to_uuid2(char const *zName, const char *zType, char **pUuid){
315 int rid = symbolic_name_to_rid(zName, zType);
316 if((rid>0) && pUuid){
317 *pUuid = db_text(NULL, "SELECT uuid FROM blob WHERE rid=%d", rid);
318 }
319 return rid;
320
--- src/name.c
+++ src/name.c
@@ -309,11 +309,11 @@
309 ** zName does not resolve, 0 is returned. If it is ambiguous, a
310 ** negative value is returned. On success the rid is returned and
311 ** pUuid (if it is not NULL) is set to the a newly-allocated string,
312 ** the full UUID, which must eventually be free()d by the caller.
313 */
314 int name_to_uuid2(const char *zName, const char *zType, char **pUuid){
315 int rid = symbolic_name_to_rid(zName, zType);
316 if((rid>0) && pUuid){
317 *pUuid = db_text(NULL, "SELECT uuid FROM blob WHERE rid=%d", rid);
318 }
319 return rid;
320
+1 -1
--- src/search.c
+++ src/search.c
@@ -191,11 +191,11 @@
191191
Stmt q;
192192
int iBest;
193193
char fAll = NULL != find_option("all", "a", 0); /* If set, do not lop
194194
off the end of the
195195
results. */
196
- char const * zLimit = find_option("limit","n",1);
196
+ const char *zLimit = find_option("limit","n",1);
197197
const char *zWidth = find_option("width","W",1);
198198
int nLimit = zLimit ? atoi(zLimit) : -1000; /* Max number of matching
199199
lines/entries to list */
200200
int width;
201201
if( zWidth ){
202202
--- src/search.c
+++ src/search.c
@@ -191,11 +191,11 @@
191 Stmt q;
192 int iBest;
193 char fAll = NULL != find_option("all", "a", 0); /* If set, do not lop
194 off the end of the
195 results. */
196 char const * zLimit = find_option("limit","n",1);
197 const char *zWidth = find_option("width","W",1);
198 int nLimit = zLimit ? atoi(zLimit) : -1000; /* Max number of matching
199 lines/entries to list */
200 int width;
201 if( zWidth ){
202
--- src/search.c
+++ src/search.c
@@ -191,11 +191,11 @@
191 Stmt q;
192 int iBest;
193 char fAll = NULL != find_option("all", "a", 0); /* If set, do not lop
194 off the end of the
195 results. */
196 const char *zLimit = find_option("limit","n",1);
197 const char *zWidth = find_option("width","W",1);
198 int nLimit = zLimit ? atoi(zLimit) : -1000; /* Max number of matching
199 lines/entries to list */
200 int width;
201 if( zWidth ){
202
+6 -6
--- src/style.c
+++ src/style.c
@@ -388,11 +388,11 @@
388388
}
389389
style_ad_unit();
390390
@ <div class="content">
391391
cgi_destination(CGI_BODY);
392392
393
- if (sideboxUsed) {
393
+ if( sideboxUsed ){
394394
/* Put the footer at the bottom of the page.
395395
** the additional clear/both is needed to extend the content
396396
** part to the end of an optional sidebox.
397397
*/
398398
@ <div class="endContent"></div>
@@ -657,13 +657,13 @@
657657
/* The following table contains bits of default CSS that must
658658
** be included if they are not found in the application-defined
659659
** CSS.
660660
*/
661661
const struct strctCssDefaults {
662
- char const * const elementClass; /* Name of element needed */
663
- char const * const comment; /* Comment text */
664
- char const * const value; /* CSS text */
662
+ const char *elementClass; /* Name of element needed */
663
+ const char *comment; /* Comment text */
664
+ const char *value; /* CSS text */
665665
} cssDefaultList[] = {
666666
{ "",
667667
"",
668668
zDefaultCSS
669669
},
@@ -1208,12 +1208,12 @@
12081208
** Append all of the default CSS to the CGI output.
12091209
*/
12101210
void cgi_append_default_css(void) {
12111211
int i;
12121212
1213
- for (i=0;cssDefaultList[i].elementClass;i++){
1214
- if (cssDefaultList[i].elementClass[0]){
1213
+ for( i=0; cssDefaultList[i].elementClass; i++ ){
1214
+ if( cssDefaultList[i].elementClass[0] ){
12151215
cgi_printf("/* %s */\n%s {\n%s\n}\n\n",
12161216
cssDefaultList[i].comment,
12171217
cssDefaultList[i].elementClass,
12181218
cssDefaultList[i].value
12191219
);
12201220
--- src/style.c
+++ src/style.c
@@ -388,11 +388,11 @@
388 }
389 style_ad_unit();
390 @ <div class="content">
391 cgi_destination(CGI_BODY);
392
393 if (sideboxUsed) {
394 /* Put the footer at the bottom of the page.
395 ** the additional clear/both is needed to extend the content
396 ** part to the end of an optional sidebox.
397 */
398 @ <div class="endContent"></div>
@@ -657,13 +657,13 @@
657 /* The following table contains bits of default CSS that must
658 ** be included if they are not found in the application-defined
659 ** CSS.
660 */
661 const struct strctCssDefaults {
662 char const * const elementClass; /* Name of element needed */
663 char const * const comment; /* Comment text */
664 char const * const value; /* CSS text */
665 } cssDefaultList[] = {
666 { "",
667 "",
668 zDefaultCSS
669 },
@@ -1208,12 +1208,12 @@
1208 ** Append all of the default CSS to the CGI output.
1209 */
1210 void cgi_append_default_css(void) {
1211 int i;
1212
1213 for (i=0;cssDefaultList[i].elementClass;i++){
1214 if (cssDefaultList[i].elementClass[0]){
1215 cgi_printf("/* %s */\n%s {\n%s\n}\n\n",
1216 cssDefaultList[i].comment,
1217 cssDefaultList[i].elementClass,
1218 cssDefaultList[i].value
1219 );
1220
--- src/style.c
+++ src/style.c
@@ -388,11 +388,11 @@
388 }
389 style_ad_unit();
390 @ <div class="content">
391 cgi_destination(CGI_BODY);
392
393 if( sideboxUsed ){
394 /* Put the footer at the bottom of the page.
395 ** the additional clear/both is needed to extend the content
396 ** part to the end of an optional sidebox.
397 */
398 @ <div class="endContent"></div>
@@ -657,13 +657,13 @@
657 /* The following table contains bits of default CSS that must
658 ** be included if they are not found in the application-defined
659 ** CSS.
660 */
661 const struct strctCssDefaults {
662 const char *elementClass; /* Name of element needed */
663 const char *comment; /* Comment text */
664 const char *value; /* CSS text */
665 } cssDefaultList[] = {
666 { "",
667 "",
668 zDefaultCSS
669 },
@@ -1208,12 +1208,12 @@
1208 ** Append all of the default CSS to the CGI output.
1209 */
1210 void cgi_append_default_css(void) {
1211 int i;
1212
1213 for( i=0; cssDefaultList[i].elementClass; i++ ){
1214 if( cssDefaultList[i].elementClass[0] ){
1215 cgi_printf("/* %s */\n%s {\n%s\n}\n\n",
1216 cssDefaultList[i].comment,
1217 cssDefaultList[i].elementClass,
1218 cssDefaultList[i].value
1219 );
1220

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button