mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-21 16:18:29 -04:00
AP_HAL: Remove Util::{v,}snprintf_P()
This commit is contained in:
parent
84d5fb006f
commit
a8455aa4e3
@ -37,16 +37,6 @@ int AP_HAL::Util::snprintf(char* str, size_t size, const char *format, ...)
|
||||
return res;
|
||||
}
|
||||
|
||||
int AP_HAL::Util::snprintf_P(char* str, size_t size, const prog_char_t *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, format);
|
||||
int res = vsnprintf_P(str, size, format, ap);
|
||||
va_end(ap);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
int AP_HAL::Util::vsnprintf(char* str, size_t size, const char *format, va_list ap)
|
||||
{
|
||||
BufferPrinter buf(str, size);
|
||||
@ -56,14 +46,3 @@ int AP_HAL::Util::vsnprintf(char* str, size_t size, const char *format, va_list
|
||||
buf.write(0);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int AP_HAL::Util::vsnprintf_P(char* str, size_t size, const prog_char_t *format,
|
||||
va_list ap)
|
||||
{
|
||||
BufferPrinter buf(str, size);
|
||||
print_vprintf(&buf, 1,(const char*) format, ap);
|
||||
int ret = buf._offs;
|
||||
// null terminate if possible
|
||||
buf.write(0);
|
||||
return ret;
|
||||
}
|
||||
|
@ -4,22 +4,15 @@
|
||||
|
||||
#include <stdarg.h>
|
||||
#include "AP_HAL_Namespace.h"
|
||||
#include <AP_Progmem/AP_Progmem.h>
|
||||
|
||||
class AP_HAL::Util {
|
||||
public:
|
||||
int snprintf(char* str, size_t size,
|
||||
const char *format, ...);
|
||||
|
||||
int snprintf_P(char* str, size_t size,
|
||||
const prog_char_t *format, ...);
|
||||
|
||||
int vsnprintf(char* str, size_t size,
|
||||
const char *format, va_list ap);
|
||||
|
||||
int vsnprintf_P(char* str, size_t size,
|
||||
const prog_char_t *format, va_list ap);
|
||||
|
||||
void set_soft_armed(const bool b) { soft_armed = b; }
|
||||
bool get_soft_armed() const { return soft_armed; }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user