mirror of
https://git.openafs.org/openafs.git
synced 2025-01-20 07:51:00 +00:00
Prototype warning cleanup - big endian
Move function definitions above their use in quad_cksum.c and remove the (incomplete) prototypes. Clears up a few warnings on big endian systems. Change-Id: Id860f904fff9fb033ee4b2032162304a4af7423a Reviewed-on: http://gerrit.openafs.org/2601 Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
This commit is contained in:
parent
3fc5863f06
commit
de341580a6
@ -87,14 +87,44 @@
|
||||
#define vaxtohl(x) (*((afs_uint32 *)(x)))
|
||||
#define vaxtohs(x) (*((unsigned short *)(x)))
|
||||
#else
|
||||
static afs_uint32 four_bytes_vax_to_nets();
|
||||
#define vaxtohl(x) four_bytes_vax_to_nets((char *)(x))
|
||||
static unsigned short two_bytes_vax_to_nets();
|
||||
#define vaxtohs(x) two_bytes_vax_to_nets((char *)(x))
|
||||
#endif
|
||||
|
||||
/*** Routines ***************************************************** */
|
||||
|
||||
#ifdef MSBFIRST
|
||||
|
||||
static unsigned short
|
||||
two_bytes_vax_to_nets(char *p)
|
||||
{
|
||||
union {
|
||||
char pieces[2];
|
||||
unsigned short result;
|
||||
} short_conv;
|
||||
|
||||
short_conv.pieces[0] = p[1];
|
||||
short_conv.pieces[1] = p[0];
|
||||
return (short_conv.result);
|
||||
}
|
||||
|
||||
static afs_uint32
|
||||
four_bytes_vax_to_nets(char *p)
|
||||
{
|
||||
union {
|
||||
char pieces[4];
|
||||
afs_uint32 result;
|
||||
} long_conv;
|
||||
|
||||
long_conv.pieces[0] = p[3];
|
||||
long_conv.pieces[1] = p[2];
|
||||
long_conv.pieces[2] = p[1];
|
||||
long_conv.pieces[3] = p[0];
|
||||
return (long_conv.result);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
des_cblock *c_seed; * secret seed, 8 bytes *
|
||||
unsigned char *in; * input block *
|
||||
@ -159,35 +189,3 @@ des_quad_cksum(unsigned char *in, afs_uint32 * out, afs_int32 length,
|
||||
/* return final z value as 32 bit version of checksum */
|
||||
return z;
|
||||
}
|
||||
|
||||
#ifdef MSBFIRST
|
||||
|
||||
static unsigned short
|
||||
two_bytes_vax_to_nets(char *p)
|
||||
{
|
||||
union {
|
||||
char pieces[2];
|
||||
unsigned short result;
|
||||
} short_conv;
|
||||
|
||||
short_conv.pieces[0] = p[1];
|
||||
short_conv.pieces[1] = p[0];
|
||||
return (short_conv.result);
|
||||
}
|
||||
|
||||
static afs_uint32
|
||||
four_bytes_vax_to_nets(char *p)
|
||||
{
|
||||
union {
|
||||
char pieces[4];
|
||||
afs_uint32 result;
|
||||
} long_conv;
|
||||
|
||||
long_conv.pieces[0] = p[3];
|
||||
long_conv.pieces[1] = p[2];
|
||||
long_conv.pieces[2] = p[1];
|
||||
long_conv.pieces[3] = p[0];
|
||||
return (long_conv.result);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user