Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/alarm/alarm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ int main(int argc, FAR char *argv[])

setrel.id = alarmid;
setrel.pid = g_alarm_daemon_pid;
setrel.reltime = (time_t)seconds;
setrel.reltime = seconds;

setrel.event.sigev_notify = SIGEV_SIGNAL;
setrel.event.sigev_signo = CONFIG_EXAMPLES_ALARM_SIGNO;
Expand Down
2 changes: 1 addition & 1 deletion examples/dronecan/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
config EXAMPLES_DRONECAN
tristate "DroneCAN example"
default n
depends on CANUTILS_LIBDRONECAN && SYSTEM_TIME64
depends on CANUTILS_LIBDRONECAN
---help---
Enable the LIBDRONECAN example

Expand Down
4 changes: 0 additions & 4 deletions examples/netlink_route/netlink_route_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,7 @@ static void dump_neighbor(void)
printf(" ");
}

#ifdef CONFIG_SYSTEM_TIME64
printf("Time 0x%" PRIx64 "\n", nb->ne_time);
#else
printf("Time 0x%" PRIx32 "\n", nb->ne_time);
#endif
}

free(nbtab);
Expand Down
4 changes: 0 additions & 4 deletions examples/noteprintf/noteprintf_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ int main(int argc, FAR char *argv[])
short s = 2;
int i = 3;
long l = 4;
#ifdef CONFIG_HAVE_LONG_LONG
long long ll = 5;
#endif
intmax_t im = 6;
size_t sz = 7;
ptrdiff_t ptr = 8;
Expand All @@ -78,9 +76,7 @@ int main(int argc, FAR char *argv[])
sched_note_printf(NOTE_TAG_ALWAYS, "%hd", s);
sched_note_printf(NOTE_TAG_ALWAYS, "%d", i);
sched_note_printf(NOTE_TAG_ALWAYS, "%ld", l);
#ifdef CONFIG_HAVE_LONG_LONG
sched_note_printf(NOTE_TAG_ALWAYS, "%lld", ll);
#endif
sched_note_printf(NOTE_TAG_ALWAYS, "%jd", im);
sched_note_printf(NOTE_TAG_ALWAYS, "%zd", sz);
sched_note_printf(NOTE_TAG_ALWAYS, "%td", ptr);
Expand Down
4 changes: 0 additions & 4 deletions examples/nxscope/nxscope_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,15 +341,13 @@ static FAR void *nxscope_samples_thr(FAR void *arg)

nxscope_put_b16(envp->nxs, 13, ftob16(-1.0f));

#ifdef CONFIG_HAVE_LONG_LONG
/* Channel 14 */

nxscope_put_ub32(envp->nxs, 14, dtob32(1.0));

/* Channel 15 */

nxscope_put_b32(envp->nxs, 15, dtob32(-1.0));
#endif

/* Channel 16 */

Expand Down Expand Up @@ -711,7 +709,6 @@ int main(int argc, FAR char *argv[])
u.s.cri = 0;
nxscope_chan_init(&nxs, 13, "chan13", u.u8, 1, 0);

#ifdef CONFIG_HAVE_LONG_LONG
u.s.dtype = NXSCOPE_TYPE_UB32;
u.s._res = 0;
u.s.cri = 0;
Expand All @@ -721,7 +718,6 @@ int main(int argc, FAR char *argv[])
u.s._res = 0;
u.s.cri = 0;
nxscope_chan_init(&nxs, 15, "chan15", u.u8, 1, 0);
#endif

/* Vector data channel */

Expand Down
40 changes: 6 additions & 34 deletions fsutils/mkfatfs/configfat.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,8 @@ static inline uint32_t
mkfatfs_nfatsect12(FAR struct fat_format_s *fmt, FAR struct fat_var_s *var,
uint32_t navailsects)
{
#ifdef CONFIG_HAVE_LONG_LONG
uint64_t denom;
uint64_t number;
#else
uint32_t denom;
uint32_t number;
#endif

/* For FAT12, the cluster number is held in a 12-bit number or 1.5 bytes
* per cluster reference. So each FAT sector will hold sectorsize/1.5
Expand Down Expand Up @@ -156,25 +151,12 @@ mkfatfs_nfatsect12(FAR struct fat_format_s *fmt, FAR struct fat_var_s *var,
* navailsects > 0x55555555 - 2 * clustersize
*/

#ifndef CONFIG_HAVE_LONG_LONG
if (navailsects <= (0x55555555 - (1 << (fmt->ff_clustshift + 1))))
{
#endif

denom = (fmt->ff_nfats << 1) + fmt->ff_nfats
+ (var->fv_sectorsize << (fmt->ff_clustshift + 1));
number = (navailsects << 1) + navailsects
+ (1 << (fmt->ff_clustshift + 2))
+ (1 << (fmt->ff_clustshift + 1));
return (uint32_t)((number + denom - 1) / denom);

#ifndef CONFIG_HAVE_LONG_LONG
}
else
{
return 0;
}
#endif
denom = (fmt->ff_nfats << 1) + fmt->ff_nfats
+ (var->fv_sectorsize << (fmt->ff_clustshift + 1));
number = (navailsects << 1) + navailsects
+ (1 << (fmt->ff_clustshift + 2))
+ (1 << (fmt->ff_clustshift + 1));
return (uint32_t)((number + denom - 1) / denom);
}

/****************************************************************************
Expand All @@ -201,13 +183,8 @@ static inline uint32_t
mkfatfs_nfatsect16(FAR struct fat_format_s *fmt, FAR struct fat_var_s *var,
uint32_t navailsects)
{
#ifdef CONFIG_HAVE_LONG_LONG
uint64_t denom;
uint64_t number;
#else
uint32_t denom;
uint32_t number;
#endif

/* For FAT16, the cluster number is held in a 16-bit number or 2 bytes per
* cluster reference. So each FAT sector will hold sectorsize/2 cluster
Expand Down Expand Up @@ -270,13 +247,8 @@ static inline uint32_t
mkfatfs_nfatsect32(FAR struct fat_format_s *fmt, FAR struct fat_var_s *var,
uint32_t navailsects)
{
#ifdef CONFIG_HAVE_LONG_LONG
uint64_t denom;
uint64_t number;
#else
uint32_t denom;
uint32_t number;
#endif

/* For FAT32, the cluster number is held in a 32-bit number or 4 bytes per
* cluster reference. So each FAT sector will hold sectorsize/4 cluster
Expand Down
2 changes: 0 additions & 2 deletions logging/nxscope/nxscope_chan.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,6 @@ static int nxscope_put_vector(FAR uint8_t *buff, uint8_t type, FAR void *val,
break;
}

#ifdef CONFIG_HAVE_LONG_LONG
case NXSCOPE_TYPE_UINT64:
case NXSCOPE_TYPE_INT64:
case NXSCOPE_TYPE_DOUBLE:
Expand All @@ -358,7 +357,6 @@ static int nxscope_put_vector(FAR uint8_t *buff, uint8_t type, FAR void *val,

break;
}
#endif

case NXSCOPE_TYPE_CHAR:
{
Expand Down
2 changes: 1 addition & 1 deletion netutils/dhcpd/dhcpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ static inline bool dhcpd_parseoptions(void)
if (optlen >= 6 && optlen < remaining)
{
memcpy(&tmp, &ptr[DHCPD_OPTION_DATA], 4);
g_state.ds_optleasetime = (time_t)ntohl(tmp);
g_state.ds_optleasetime = ntohl(tmp);
}
break;

Expand Down
8 changes: 2 additions & 6 deletions netutils/ftpd/ftpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2305,11 +2305,11 @@ static int ftpd_listbuffer(FAR struct ftpd_session_s *session,

/* time */

memcpy(&tm, localtime((FAR const time_t *)&st->st_mtime), sizeof(tm));
memcpy(&tm, localtime(&st->st_mtime), sizeof(tm));
offset += snprintf(&buffer[offset], buflen - offset, " %s %2u",
g_monthtab[tm.tm_mon], tm.tm_mday);
now = time(0);
if ((now - st->st_mtime) > (time_t)(60 * 60 * 24 * 180))
if (now - st->st_mtime > 60 * 60 * 24 * 180)
{
offset += snprintf(&buffer[offset], buflen - offset, " %5u",
tm.tm_year + 1900);
Expand Down Expand Up @@ -3735,11 +3735,7 @@ static int ftpd_command_appe(FAR struct ftpd_session_s *session)

static int ftpd_command_rest(FAR struct ftpd_session_s *session)
{
#ifdef CONFIG_HAVE_LONG_LONG
session->restartpos = (off_t)atoll(session->param);
#else
session->restartpos = (off_t)atoi(session->param);
#endif
session->flags |= FTPD_SESSIONFLAG_RESTARTPOS;

return ftpd_response(session->cmd.sd, session->txtimeout,
Expand Down
6 changes: 1 addition & 5 deletions netutils/netinit/netinit.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,7 @@
* signal indicating a change in network status.
*/

#ifdef CONFIG_SYSTEM_TIME64
# define LONG_TIME_SEC (60*60) /* One hour in seconds */
#else
# define LONG_TIME_SEC (5*60) /* Five minutes in seconds */
#endif
#define LONG_TIME_SEC (60*60) /* One hour in seconds */

#define SHORT_TIME_SEC (2) /* 2 seconds */

Expand Down
4 changes: 0 additions & 4 deletions netutils/ntpclient/ntpclient.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@

/* Configuration ************************************************************/

#ifndef CONFIG_HAVE_LONG_LONG
# error "64-bit integer support required for NTP client"
#endif

#if defined(CONFIG_LIBC_NETDB) && !defined(CONFIG_NETUTILS_NTPCLIENT_SERVER)
# error "CONFIG_NETUTILS_NTPCLIENT_SERVER must be provided"
#endif
Expand Down
7 changes: 0 additions & 7 deletions netutils/ptpd/ptpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,8 @@ static void timespec_to_ptp_format(FAR const struct timespec *ts,
* both fields big-endian.
*/

#ifdef CONFIG_SYSTEM_TIME64
timestamp[0] = (uint8_t)(ts->tv_sec >> 40);
timestamp[1] = (uint8_t)(ts->tv_sec >> 32);
#else
timestamp[0] = 0;
timestamp[1] = 0;
#endif
timestamp[2] = (uint8_t)(ts->tv_sec >> 24);
timestamp[3] = (uint8_t)(ts->tv_sec >> 16);
timestamp[4] = (uint8_t)(ts->tv_sec >> 8);
Expand Down Expand Up @@ -320,7 +315,6 @@ static int64_t timespec_delta_ns(FAR const struct timespec *ts1,

delta_s = ts1->tv_sec - ts2->tv_sec;

#ifdef CONFIG_SYSTEM_TIME64
/* Conversion to nanoseconds could overflow if the system time is 64-bit */

if (delta_s >= INT64_MAX / NSEC_PER_SEC)
Expand All @@ -331,7 +325,6 @@ static int64_t timespec_delta_ns(FAR const struct timespec *ts1,
{
return INT64_MIN;
}
#endif

return delta_s * NSEC_PER_SEC + (ts1->tv_nsec - ts2->tv_nsec);
}
Expand Down
16 changes: 8 additions & 8 deletions netutils/thttpd/libhttpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ static void send_mime(httpd_conn *hc, int status, const char *title,
(hc->range_end >= hc->range_start) &&
((hc->range_end != length - 1) ||
(hc->range_start != 0)) &&
(hc->range_if == (time_t) - 1 || hc->range_if == hc->sb.st_mtime))
(hc->range_if == -1 || hc->range_if == hc->sb.st_mtime))
{
partial_content = 1;
status = 206;
Expand All @@ -340,7 +340,7 @@ static void send_mime(httpd_conn *hc, int status, const char *title,
}

gettimeofday(&now, NULL);
if (mod == (time_t)0)
if (mod == 0)
{
mod = now.tv_sec;
}
Expand Down Expand Up @@ -510,7 +510,7 @@ static int send_err_file(httpd_conn *hc, int status, char *title,
}

send_mime(hc, status, title, "", extraheads, "text/html; charset=%s",
(off_t)-1, (time_t)0);
-1, 0);
for (; ; )
{
nread = fread(buf, 1, sizeof(buf) - 1, fp);
Expand Down Expand Up @@ -2421,8 +2421,8 @@ int httpd_get_conn(httpd_server *hs, int listen_fd, httpd_conn *hc)
hc->altdir[0] = '\0';
#endif
hc->buflen = 0;
hc->if_modified_since = (time_t) - 1;
hc->range_if = (time_t)-1;
hc->if_modified_since = -1;
hc->range_if = -1;
hc->contentlength = -1;
hc->type = "";
#ifdef CONFIG_THTTPD_VHOST
Expand Down Expand Up @@ -2926,7 +2926,7 @@ int httpd_parse_request(httpd_conn *hc)
{
cp = &buf[18];
hc->if_modified_since = tdate_parse(cp);
if (hc->if_modified_since == (time_t) - 1)
if (hc->if_modified_since == -1)
{
nerr("ERROR: unparsable time: %s\n", cp);
}
Expand Down Expand Up @@ -2973,7 +2973,7 @@ int httpd_parse_request(httpd_conn *hc)
{
cp = &buf[9];
hc->range_if = tdate_parse(cp);
if (hc->range_if == (time_t) - 1)
if (hc->range_if == -1)
{
nerr("ERROR: unparsable time: %s\n", cp);
}
Expand Down Expand Up @@ -3521,7 +3521,7 @@ int httpd_start_request(httpd_conn *hc, struct timeval *nowp)
send_mime(hc, 200, ok200title, hc->encodings, "", hc->type,
hc->sb.st_size, hc->sb.st_mtime);
}
else if (hc->if_modified_since != (time_t) - 1 &&
else if (hc->if_modified_since != -1 &&
hc->if_modified_since >= hc->sb.st_mtime)
{
send_mime(hc, 304, err304title, hc->encodings, "",
Expand Down
2 changes: 1 addition & 1 deletion netutils/thttpd/tdate_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ time_t tdate_parse(char *str)
#endif /* Day of week not yet supported by NuttX */
else
{
return (time_t) - 1;
return -1;
}

if (tm.tm_year > 1900)
Expand Down
2 changes: 1 addition & 1 deletion system/resmonitor/filldisk.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ int main(int argc, FAR char *argv[])
mode = 1;
break;
case 'i':
interval = (time_t)bytes(optarg);
interval = bytes(optarg);
break;
case 'b':
bufsize = bytes(optarg);
Expand Down
4 changes: 0 additions & 4 deletions system/zmodem/host/nuttx/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@

/* GCC supports both types double and long long */

# define CONFIG_HAVE_LONG_LONG 1
# define CONFIG_HAVE_FLOAT 1
# define CONFIG_HAVE_DOUBLE 1
# define CONFIG_HAVE_LONG_DOUBLE 1
Expand Down Expand Up @@ -323,7 +322,6 @@

/* SDCC does not support type long long or type double */

# undef CONFIG_HAVE_LONG_LONG
# define CONFIG_HAVE_FLOAT 1
# undef CONFIG_HAVE_DOUBLE
# undef CONFIG_HAVE_LONG_DOUBLE
Expand Down Expand Up @@ -431,7 +429,6 @@
* and simply do not support long long or double.
*/

# undef CONFIG_HAVE_LONG_LONG
# define CONFIG_HAVE_FLOAT 1
# undef CONFIG_HAVE_DOUBLE
# undef CONFIG_HAVE_LONG_DOUBLE
Expand Down Expand Up @@ -507,7 +504,6 @@
# undef CONFIG_SMALL_MEMORY
# undef CONFIG_LONG_IS_NOT_INT
# undef CONFIG_PTR_IS_NOT_INT
# undef CONFIG_HAVE_LONG_LONG
# define CONFIG_HAVE_FLOAT 1
# undef CONFIG_HAVE_DOUBLE
# undef CONFIG_HAVE_LONG_DOUBLE
Expand Down
2 changes: 1 addition & 1 deletion system/zmodem/zm_receive.c
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ static int zmr_filename(FAR struct zm_state_s *pzm)

pzmr->filesize = (off_t)filesize;
#ifdef CONFIG_SYSTEM_ZMODEM_TIMESTAMPS
pzmr->timestamp = (time_t)timestamp;
pzmr->timestamp = timestamp;
#endif

/* Check if we need to send the CRC */
Expand Down
Loading
Loading