AP_HAL: Remove Util::{v,}snprintf_P()

This commit is contained in:
Lucas De Marchi 2015-10-24 20:10:14 -02:00 committed by Randy Mackay
parent 84d5fb006f
commit a8455aa4e3
2 changed files with 0 additions and 28 deletions

View File

@ -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;
}

View File

@ -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; }