mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 02:37:10 +00:00 
			
		
		
		
	tests: Fix compilation errors on 32-bit.
Fix compilation errors caused by using size_t instead of uintmax_t and non-portable format specifiers. ASTERISK-30273 #close Change-Id: I363e6057ef84d54b88af80d23ad6147eef9216ee
This commit is contained in:
		
				
					committed by
					
						 Joshua Colp
						Joshua Colp
					
				
			
			
				
	
			
			
			
						parent
						
							093593a7c8
						
					
				
				
					commit
					3989977402
				
			| @@ -63,11 +63,13 @@ static int expect_null; | ||||
| static int validate_data(const char *id, struct foo_data *foo) | ||||
| { | ||||
| 	size_t num; | ||||
| 	uintmax_t tmp; | ||||
|  | ||||
| 	if (ast_str_to_umax(id, &num)) { | ||||
| 	if (ast_str_to_umax(id, &tmp)) { | ||||
| 		ast_log(LOG_ERROR, "Unable to convert the state's id '%s' to numeric\n", id); | ||||
| 		return -1; | ||||
| 	} | ||||
| 	num = (size_t) tmp; | ||||
|  | ||||
| 	running_total += num; | ||||
|  | ||||
| @@ -247,6 +249,7 @@ static struct stasis_message *create_foo_type_message(const char *id) | ||||
| { | ||||
| 	struct stasis_message *msg; | ||||
| 	struct foo_data *foo; | ||||
| 	uintmax_t tmp; | ||||
|  | ||||
| 	foo = ao2_alloc(sizeof(*foo), NULL); | ||||
| 	if (!foo) { | ||||
| @@ -254,11 +257,12 @@ static struct stasis_message *create_foo_type_message(const char *id) | ||||
| 		return NULL; | ||||
| 	} | ||||
|  | ||||
| 	if (ast_str_to_umax(id, &foo->bar)) { | ||||
| 	if (ast_str_to_umax(id, &tmp)) { | ||||
| 		ast_log(LOG_ERROR, "Unable to convert the state's id '%s' to numeric\n", id); | ||||
| 		ao2_ref(foo, -1); | ||||
| 		return NULL; | ||||
| 	} | ||||
| 	foo->bar = (size_t) tmp; | ||||
|  | ||||
| 	msg = stasis_message_create_full(foo_type(), foo, NULL); | ||||
| 	if (!msg) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user