From 199d1080636ef73057b1685d23f6cb7c532a8705 Mon Sep 17 00:00:00 2001 From: Fahrzin Hemmati Date: Mon, 31 Jul 2017 06:25:21 -0700 Subject: [PATCH] Update comments for code review --- platform/mbed_retarget.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platform/mbed_retarget.cpp b/platform/mbed_retarget.cpp index d793f30904..351a941ab4 100644 --- a/platform/mbed_retarget.cpp +++ b/platform/mbed_retarget.cpp @@ -228,7 +228,7 @@ extern "C" FILEHANDLE PREFIX(_open)(const char* name, int openmode) { FileHandle *res = NULL; - /* FILENAME: ":0x12345678" describes a FileHandle* */ + /* FILENAME: ":(pointer)" describes a FileHandle* */ if (name[0] == ':') { void *p; memcpy(&p, name + 1, sizeof(p)); @@ -826,6 +826,7 @@ void mbed_set_unbuffered_stream(std::FILE *_file) { */ std::FILE *mbed_fdopen(FileHandle *fh, const char *mode) { + // This is to avoid scanf(buf, ":%.4s", fh) and the bloat it brings. char buf[2 + sizeof(fh) + 1]; /* :(pointer) + null byte */ static_assert(sizeof(buf) == 7, "Pointers should be 4 bytes."); buf[0] = ':';