preserve the "special" values.
**************************************************************/
-uint32 convert_time_t_to_uint32(time_t t)
+uint32_t convert_time_t_to_uint32(time_t t)
{
#if (defined(SIZEOF_TIME_T) && (SIZEOF_TIME_T == 8))
/* time_t is 64-bit. */
return 0x7FFFFFFF;
}
#endif
- return (uint32)t;
+ return (uint32_t)t;
}
-time_t convert_uint32_to_time_t(uint32 u)
+time_t convert_uint32_to_time_t(uint32_t u)
{
#if (defined(SIZEOF_TIME_T) && (SIZEOF_TIME_T == 8))
/* time_t is 64-bit. */
static void put_dos_date(char *buf,int offset,time_t unixdate, int zone_offset)
{
- uint32 x = make_dos_date(unixdate, zone_offset);
+ uint32_t x = make_dos_date(unixdate, zone_offset);
SIVAL(buf,offset,x);
}
static void put_dos_date2(char *buf,int offset,time_t unixdate, int zone_offset)
{
- uint32 x = make_dos_date(unixdate, zone_offset);
+ uint32_t x = make_dos_date(unixdate, zone_offset);
x = ((x&0xFFFF)<<16) | ((x&0xFFFF0000)>>16);
SIVAL(buf,offset,x);
}
static time_t make_unix_date(const void *date_ptr, int zone_offset)
{
- uint32 dos_date=0;
+ uint32_t dos_date=0;
struct tm t;
time_t ret;
static time_t make_unix_date2(const void *date_ptr, int zone_offset)
{
- uint32 x,x2;
+ uint32_t x,x2;
x = IVAL(date_ptr,0);
x2 = ((x&0xFFFF)<<16) | ((x&0xFFFF0000)>>16);
time_t nt_time_to_unix_abs(const NTTIME *nt)
{
- uint64 d;
+ uint64_t d;
if (*nt == 0) {
return (time_t)0;
}
- if (*nt == (uint64)-1) {
+ if (*nt == (uint64_t)-1) {
return (time_t)-1;
}
void unix_timespec_to_nt_time(NTTIME *nt, struct timespec ts)
{
- uint64 d;
+ uint64_t d;
if (ts.tv_sec ==0 && ts.tv_nsec == 0) {
*nt = 0;
return;
}
if (ts.tv_sec == (time_t)-1) {
- *nt = (uint64)-1;
+ *nt = (uint64_t)-1;
return;
}
bool null_mtime(time_t mtime)
{
if (mtime == 0 || mtime == (time_t)0xFFFFFFFF || mtime == (time_t)-1)
- return(True);
- return(False);
+ return true;
+ return false;
}
/****************************************************************************
bool nt_time_is_set(const NTTIME *nt)
{
if (*nt == 0x7FFFFFFFFFFFFFFFLL) {
- return False;
+ return false;
}
if (*nt == NTTIME_INFINITY) {
- return False;
+ return false;
}
- return True;
+ return true;
}
null). length *MUST BE MORE THAN 2* !
**********************************************************/
-char *pdb_encode_acct_ctrl(uint32 acct_ctrl, size_t length)
+char *pdb_encode_acct_ctrl(uint32_t acct_ctrl, size_t length)
{
fstring acct_str;
char *result;
Decode the account control bits from a string.
**********************************************************/
-uint32 pdb_decode_acct_ctrl(const char *p)
+uint32_t pdb_decode_acct_ctrl(const char *p)
{
- uint32 acct_ctrl = 0;
- bool finished = False;
+ uint32_t acct_ctrl = 0;
+ bool finished = false;
/*
* Check if the account type bits have been encoded after the
case '\n':
case '\0':
case ']':
- default: { finished = True; }
+ default: { finished = true; }
}
}
char *p1, *p2;
if (!p)
- return (False);
+ return false;
for (i = 0; i < 32; i += 2) {
hinybble = toupper_ascii(p[i]);
p2 = strchr(hexchars, lonybble);
if (!p1 || !p2)
- return (False);
+ return false;
hinybble = PTR_DIFF(p1, hexchars);
lonybble = PTR_DIFF(p2, hexchars);
pwd[i / 2] = (hinybble << 4) | lonybble;
}
- return (True);
+ return true;
}
/*************************************************************