[PATCH 4/6] sim: mips: tweak buffer sign

Mike Frysinger vapier@gentoo.org
Tue Jun 15 05:11:39 GMT 2021


This model uses unsigned char buffers, but this temporary pointer is
declared as signed.  Switch it to unsigned since it's just a temporary
variable to hold the new pointer.
---
 sim/mips/dv-tx3904sio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sim/mips/dv-tx3904sio.c b/sim/mips/dv-tx3904sio.c
index c81b2dd3a5e7..d447014014cc 100644
--- a/sim/mips/dv-tx3904sio.c
+++ b/sim/mips/dv-tx3904sio.c
@@ -582,7 +582,7 @@ tx3904sio_fifo_push(struct hw* me, struct tx3904sio_fifo* fifo, char it)
   if(fifo->size == fifo->used) /* full */
     {
       int next_size = fifo->size * 2 + 16;
-      char* next_buf = zalloc(next_size);
+      unsigned_1* next_buf = zalloc(next_size);
       memcpy(next_buf, fifo->buffer, fifo->used);
 
       if(fifo->buffer != NULL) free(fifo->buffer);
-- 
2.31.1



More information about the Gdb-patches mailing list