When building nv_data-imei in Replicant 6 we have:
  hardware/replicant/libsamsung-ipc/tools/nv_data-imei.c:
  In function 'bruteforce_imei_offset':
  hardware/replicant/libsamsung-ipc/tools/nv_data-imei.c:675:18:
  warning: pointer of type 'void *' used in subtraction [-Wpointer-arith]
               (ptr - buffer),
                    ^
Using a data type with a known size like char* avoids this error.

Signed-off-by: Denis 'GNUtoo' Carikli <gnu...@cyberdimension.org>
---
 tools/nv_data-imei.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/nv_data-imei.c b/tools/nv_data-imei.c
index 97ed66a..5ba2a05 100644
--- a/tools/nv_data-imei.c
+++ b/tools/nv_data-imei.c
@@ -619,8 +619,8 @@ int bruteforce_imei_offset(char *nv_data_path, struct imei 
*given_imei)
        size_t file_size;
        size_t search_size;
        size_t nv_data_chunk_size;
-       void *buffer = NULL;
-       void *ptr = NULL;
+       char *buffer = NULL;
+       char *ptr = NULL;
        unsigned char given_imei_buffer[(IMEI_LENGTH + 1) / 2] = { 0 };
        bool found_imei = false;
        int rc;
@@ -706,7 +706,7 @@ int read_imei(char *nv_data_path, struct offset *offset)
        struct imei imei;
        size_t file_size;
        size_t nv_data_chunk_size;
-       void *buffer = NULL;
+       unsigned char *buffer = NULL;
        int rc;
 
        memset(&imei, 0, sizeof(imei));
-- 
2.30.1

_______________________________________________
Replicant mailing list
Replicant@osuosl.org
https://lists.osuosl.org/mailman/listinfo/replicant

Reply via email to