[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH hurd 07/11] Fix a few pointer related warnings.
From: |
Flavio Cruz |
Subject: |
[PATCH hurd 07/11] Fix a few pointer related warnings. |
Date: |
Fri, 29 Dec 2023 16:21:01 -0500 |
---
utils/rpctrace.c | 4 ++--
utils/vmallocate.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/utils/rpctrace.c b/utils/rpctrace.c
index 589ce8f..f7046a0 100644
--- a/utils/rpctrace.c
+++ b/utils/rpctrace.c
@@ -810,10 +810,10 @@ print_contents (mach_msg_header_t *inp,
int first = 1;
/* Process the message data, wrapping ports and printing data. */
- while (msg_buf_ptr < (char *) inp + inp->msgh_size)
+ while ((char *) msg_buf_ptr < (char *) inp + inp->msgh_size)
{
mach_msg_type_t *const type = msg_buf_ptr;
- mach_msg_type_long_t *const lt = (void *) type;
+ mach_msg_type_long_t *const lt = (mach_msg_type_long_t *) type;
void *data;
mach_msg_type_number_t nelt; /* Number of data items. */
mach_msg_type_size_t eltsize; /* Bytes per item. */
diff --git a/utils/vmallocate.c b/utils/vmallocate.c
index 039b309..b7eafed 100644
--- a/utils/vmallocate.c
+++ b/utils/vmallocate.c
@@ -207,7 +207,7 @@ main (int argc, char **argv)
*p = 1;
if (verbose > 1
- && ((unsigned int) (p - address) & ((1U<<20) - 1)) == 0)
+ && ((uintptr_t) (p - address) & ((1UL<<20) - 1)) == 0)
fprintf (stderr, "\r%"PRIu64,
allocated
+ ((uint64_t) (uintptr_t) p - (uint64_t) address));
--
2.39.2
- [PATCH hurd 01/11] Initialize a few error variables to avoid GCC warnings, Flavio Cruz, 2023/12/29
- [PATCH hurd 02/11] Cast bootinfo to struct diskfs_control * to silence warning, Flavio Cruz, 2023/12/29
- [PATCH hurd 04/11] Fix printf format specifiers, Flavio Cruz, 2023/12/29
- [PATCH hurd 07/11] Fix a few pointer related warnings.,
Flavio Cruz <=
- [PATCH hurd 05/11] x86_64: utmp uses int32_t to store time so use a temporary variable, Flavio Cruz, 2023/12/29
- [PATCH hurd 03/11] Use mach_msg_type_number_t whenever required to avoid warnings, Flavio Cruz, 2023/12/29
- [PATCH hurd 06/11] x86_64: use 21 bytes in libps since %z might require more characters., Flavio Cruz, 2023/12/29
- [PATCH hurd 09/11] Fix overflow issues in tmpfs and vmallocate, Flavio Cruz, 2023/12/29
- [PATCH hurd 10/11] libftpconn: add out >= 2 condition to make GCC happy, Flavio Cruz, 2023/12/29