Fix argument passed to logging macros (#421)
This commit fixes two problems with the logging statements: - %p requires a void * object to be passed - %d expects an integer. For size_t objects, %zu should be used Signed-off-by: Thomas Moulard <tmoulard@amazon.com>
This commit is contained in:
		
							parent
							
								
									f98d37ec65
								
							
						
					
					
						commit
						23510fe64b
					
				
					 2 changed files with 3 additions and 3 deletions
				
			
		| 
						 | 
					@ -60,7 +60,7 @@ rcl_init(
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  RCUTILS_LOG_DEBUG_NAMED(
 | 
					  RCUTILS_LOG_DEBUG_NAMED(
 | 
				
			||||||
    ROS_PACKAGE_NAME,
 | 
					    ROS_PACKAGE_NAME,
 | 
				
			||||||
    "Initializing ROS client library, for context at address: %p", context);
 | 
					    "Initializing ROS client library, for context at address: %p", (void *) context);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // test expectation that given context is zero initialized
 | 
					  // test expectation that given context is zero initialized
 | 
				
			||||||
  if (NULL != context->impl) {
 | 
					  if (NULL != context->impl) {
 | 
				
			||||||
| 
						 | 
					@ -161,7 +161,7 @@ rcl_shutdown(rcl_context_t * context)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  RCUTILS_LOG_DEBUG_NAMED(
 | 
					  RCUTILS_LOG_DEBUG_NAMED(
 | 
				
			||||||
    ROS_PACKAGE_NAME,
 | 
					    ROS_PACKAGE_NAME,
 | 
				
			||||||
    "Shutting down ROS client library, for context at address: %p", context);
 | 
					    "Shutting down ROS client library, for context at address: %p", (void *) context);
 | 
				
			||||||
  RCL_CHECK_ARGUMENT_FOR_NULL(context, RCL_RET_INVALID_ARGUMENT);
 | 
					  RCL_CHECK_ARGUMENT_FOR_NULL(context, RCL_RET_INVALID_ARGUMENT);
 | 
				
			||||||
  RCL_CHECK_FOR_NULL_WITH_MSG(
 | 
					  RCL_CHECK_FOR_NULL_WITH_MSG(
 | 
				
			||||||
    context->impl, "context is zero-initialized", return RCL_RET_INVALID_ARGUMENT);
 | 
					    context->impl, "context is zero-initialized", return RCL_RET_INVALID_ARGUMENT);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -709,7 +709,7 @@ void expect_topics_types(
 | 
				
			||||||
  if (expect) {
 | 
					  if (expect) {
 | 
				
			||||||
    EXPECT_EQ(num_topics, nat.names.size);
 | 
					    EXPECT_EQ(num_topics, nat.names.size);
 | 
				
			||||||
  } else {
 | 
					  } else {
 | 
				
			||||||
    RCUTILS_LOG_DEBUG_NAMED(ROS_PACKAGE_NAME, "Expected topics %d, actual topics %d", num_topics,
 | 
					    RCUTILS_LOG_DEBUG_NAMED(ROS_PACKAGE_NAME, "Expected topics %zu, actual topics %zu", num_topics,
 | 
				
			||||||
      nat.names.size);
 | 
					      nat.names.size);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  ret = rcl_names_and_types_fini(&nat);
 | 
					  ret = rcl_names_and_types_fini(&nat);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue