From 8633facc865585d83fc87f411bb2fe08f20abc00 Mon Sep 17 00:00:00 2001 From: Alex Lin Date: Tue, 19 Apr 2016 09:16:42 -0500 Subject: [PATCH] trick comm byteswap functions can't handle sizes above 65536 bytes sigh, I forgot to actually set the pthread specific data. refs #187 --- trick_source/trick_utils/comm/src/tc_read_byteswap.c | 1 + trick_source/trick_utils/comm/src/tc_write_byteswap.c | 1 + 2 files changed, 2 insertions(+) diff --git a/trick_source/trick_utils/comm/src/tc_read_byteswap.c b/trick_source/trick_utils/comm/src/tc_read_byteswap.c index 3a54eb97..e2c395fa 100644 --- a/trick_source/trick_utils/comm/src/tc_read_byteswap.c +++ b/trick_source/trick_utils/comm/src/tc_read_byteswap.c @@ -33,6 +33,7 @@ int tc_read_byteswap(TCDevice * device, char *buffer, int size, ATTRIBUTES * att if (( swap_buffer = pthread_getspecific(key)) == NULL ) { swap_buffer = malloc(sizeof(struct SwapBuffer)) ; swap_buffer->size = 0 ; + pthread_setspecific(key, swap_buffer) ; } if ( (unsigned int)size > swap_buffer->size ) { unsigned int new_size = (unsigned int)size ; diff --git a/trick_source/trick_utils/comm/src/tc_write_byteswap.c b/trick_source/trick_utils/comm/src/tc_write_byteswap.c index ccef4af3..56869fe7 100644 --- a/trick_source/trick_utils/comm/src/tc_write_byteswap.c +++ b/trick_source/trick_utils/comm/src/tc_write_byteswap.c @@ -33,6 +33,7 @@ int tc_write_byteswap(TCDevice * device, char *buffer, int size, ATTRIBUTES * at if (( swap_buffer = pthread_getspecific(key)) == NULL ) { swap_buffer = malloc(sizeof(struct SwapBuffer)) ; swap_buffer->size = 0 ; + pthread_setspecific(key, swap_buffer) ; } if ( (unsigned int)size > swap_buffer->size ) { unsigned int new_size = (unsigned int)size ;