Commit Graph

9 Commits

Author SHA1 Message Date
Michael Meffie
f2f5a7bca5 CODING: one-line if statements should not have braces
Update the style guide with a declaration of the prevailing and
preferred brace style for one-line if statements and loops. Provide an
example and counter-example.

Change-Id: Iafeea977203b76c0e67385779fb4ed57f3c6699a
Reviewed-on: https://gerrit.openafs.org/12370
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2016-09-11 18:45:00 -04:00
Michael Meffie
c17d142230 CODING: update style guide for multiline comments
Document the preferred style for multiple line comment blocks and give an
example.

Change-Id: I73d6183da9014a943316e5aea1d43be2acc81ad7
Reviewed-on: https://gerrit.openafs.org/12361
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
2016-08-06 13:05:18 -04:00
Anders Kaseorg
93f7041a08 rxkad: Resolve warnings in ticket5.c
Resolves these warnings:

ticket5.c: In function ‘tkt_MakeTicket5’:
ticket5.c:574:33: warning: pointer targets in passing argument 1 of ‘_rxkad_v5_encode_EncTicketPart’ differ in signedness [-Wpointer-sign]
     code = encode_EncTicketPart(encodebuf, allocsiz, &data, &encodelen);
                                 ^
In file included from ticket5.c:80:0:
v5gen-rewrite.h:43:30: note: expected ‘unsigned char *’ but argument is of type ‘char *’
 #define encode_EncTicketPart _rxkad_v5_encode_EncTicketPart
                              ^
v5gen.c:1889:1: note: in expansion of macro ‘encode_EncTicketPart’
 encode_EncTicketPart(unsigned char *p, size_t len, const EncTicketPart * data, size_t * size)
 ^
ticket5.c:602:33: warning: pointer targets in passing argument 1 of ‘_rxkad_v5_encode_EncryptedData’ differ in signedness [-Wpointer-sign]
     code = encode_EncryptedData(ticket + *ticketLen - 1, *ticketLen, &encdata, &tl);
                                 ^
In file included from ticket5.c:80:0:
v5gen-rewrite.h:16:30: note: expected ‘unsigned char *’ but argument is of type ‘char *’
 #define encode_EncryptedData _rxkad_v5_encode_EncryptedData
                              ^
v5gen.c:690:1: note: in expansion of macro ‘encode_EncryptedData’
 encode_EncryptedData(unsigned char *p, size_t len, const EncryptedData * data, size_t * size)
 ^
ticket5.c: In function ‘tkt_DecodeTicket5’:
ticket5.c:320:10: warning: ‘plainsiz’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     code = decode_EncTicketPart((unsigned char *)plain, plainsiz, &decr_part, &siz);
          ^

Change-Id: Ic1b878f01cf82222dc258847747ce192ee5948fc
Reviewed-on: http://gerrit.openafs.org/11955
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2015-12-25 01:57:06 -05:00
Benjamin Kaduk
33020f573b CODING: permit --enable-checking with clang
Starting at 3.2, a mostly arbitrarily selected version.

Change-Id: I9f6a946e2571b939911cbf4b1b64e1d62e39e1a3
Reviewed-on: http://gerrit.openafs.org/11991
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2015-11-18 00:57:56 -05:00
Anders Kaseorg
64eb76eebb kauth: Resolve date signedness warning in SetFields
Resolves this warning:

admin_tools.c: In function ‘SetFields’:
admin_tools.c:611:30: warning: pointer targets in passing argument 2 of ‘ktime_DateToInt32’ differ in signedness [-Wpointer-sign]
  code = ktime_DateToInt32(s, &expiration);
                              ^
In file included from /home/anders/wd/openafs/include/afs/afsutil.h:84:0,
                 from admin_tools.c:39:
/home/anders/wd/openafs/include/afs/afsutil_prototypes.h:101:18: note: expected ‘afs_int32 *’ but argument is of type ‘afs_uint32 *’
 extern afs_int32 ktime_DateToInt32(char *adate, afs_int32 * aint32);
                  ^

Change-Id: Id24e7a6cd1ab2291c0c05d3835f4ad7fddfec8d7
Reviewed-on: http://gerrit.openafs.org/11956
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2015-08-26 21:36:36 -04:00
Anders Kaseorg
8d75f24aae libadmin: #define UBIK_LEGACY_CALLITER 1 in afs_kasAdmin.c
Replaces this warning:

afs_kasAdmin.c: In function ‘GetPrincipalLockStatus’:
afs_kasAdmin.c:710:6: warning: implicit declaration of function ‘ubik_CallIter’ [-Wimplicit-function-declaration]
      ubik_CallIter(KAM_LockStatus, kaserver->servers, UPUBIKONLY,
      ^

with these marginally less alarming warnings:

In file included from ../adminutil/afs_AdminInternal.h:17:0,
                 from afs_kasAdmin.c:21:
/home/anders/wd/openafs/include/ubik.h:627:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
 extern afs_int32 ubik_CallIter(int (*aproc) (), struct ubik_client *aclient,
 ^
/home/anders/wd/openafs/include/ubik.h:632:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
 extern afs_int32 ubik_Call_New(int (*aproc) (), struct ubik_client
 ^

Change-Id: I49dbc5f6bb9199764c73c6ee8449d62518f377e6
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/11954
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2015-08-01 00:39:12 -04:00
Michael Meffie
18511623f2 readme: move README.WARNINGS to CODING
Move the information about compiler warnings to the CODING
readme file.

Change-Id: I0be752c76ddee809fe80bd1f97048953eeee89ee
Reviewed-on: http://gerrit.openafs.org/10975
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>
2014-05-21 07:19:36 -04:00
Michael Meffie
eff41a2e53 readme: move git info to CODING
Move the REAME.GIT information to the CODING readme file.

Change-Id: I3013e03ebfe003dce23f0e2d808ab6905dd2b452
Reviewed-on: http://gerrit.openafs.org/10974
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>
2014-05-21 07:19:21 -04:00
Michael Meffie
04c7ed855e readme: rename README.DEVEL to CODING
Rename the developer's readme file to CODING as a home
for developer related information.

Change-Id: I8c2cf70258671387b926ef3d666f6476056ef06e
Reviewed-on: http://gerrit.openafs.org/10973
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>
2014-05-21 07:19:06 -04:00