diff options
author | Marco Paland <marco@paland.com> | 2018-05-18 17:50:04 +0200 |
---|---|---|
committer | Marco Paland <marco@paland.com> | 2018-05-18 17:50:04 +0200 |
commit | 0116b7491693306e613491b7ccc44743da6d60cb (patch) | |
tree | 87092a1fef3ea496e6dd00ca82062c05abfa3b2a | |
parent | 9351e5b1ac8e3871bf8a37fc3c24c120cf0e5614 (diff) | |
download | printf-0116b7491693306e613491b7ccc44743da6d60cb.tar.gz printf-0116b7491693306e613491b7ccc44743da6d60cb.tar.bz2 printf-0116b7491693306e613491b7ccc44743da6d60cb.zip |
refactor(printf): changed oprintf() to fctprintf()
fctprintf() is more descriptive for its operation
-rw-r--r-- | README.md | 4 | ||||
-rw-r--r-- | printf.c | 2 | ||||
-rw-r--r-- | printf.h | 2 | ||||
-rw-r--r-- | test/test_suite.cpp | 4 |
4 files changed, 6 insertions, 6 deletions
@@ -51,8 +51,8 @@ int sprintf(char* buffer, const char* format, ...); int snprintf(char* buffer, size_t count, const char* format, ...);
int vsnprintf(char* buffer, size_t count, const char* format, va_list va);
-// write to output function (instead of buffer)
-int oprintf(void (*out)(char character), const char* format, ...);
+// call output function (instead of buffer)
+int fctprintf(void (*out)(char character), const char* format, ...);
```
@@ -691,7 +691,7 @@ int vsnprintf(char* buffer, size_t count, const char* format, va_list va) }
-int oprintf(void (*out)(char character), const char* format, ...)
+int fctprintf(void (*out)(char character), const char* format, ...)
{
va_list va;
va_start(va, format);
@@ -87,7 +87,7 @@ int vsnprintf(char* buffer, size_t count, const char* format, va_list va); * \param format A string that specifies the format of the output
* \return The number of characters that are sent to the output function, not counting the terminating null character
*/
-int oprintf(void (*out)(char character), const char* format, ...);
+int fctprintf(void (*out)(char character), const char* format, ...);
#ifdef __cplusplus
diff --git a/test/test_suite.cpp b/test/test_suite.cpp index c5614b0..4bc773a 100644 --- a/test/test_suite.cpp +++ b/test/test_suite.cpp @@ -57,10 +57,10 @@ TEST_CASE("printf", "[]" ) { }
-TEST_CASE("oprintf", "[]" ) {
+TEST_CASE("fctprintf", "[]" ) {
printf_idx = 0U;
memset(printf_buffer, 0xCC, 100U);
- test::oprintf(&test::_putchar, "This is a test of %X", 0x12EFU);
+ test::fctprintf(&test::_putchar, "This is a test of %X", 0x12EFU);
REQUIRE(!strcmp(printf_buffer, "This is a test of 12EF"));
}
|