diff --git a/editor/libeditor/html/TextEditorTest.cpp b/editor/libeditor/html/TextEditorTest.cpp
index 10015bcc3e6..e13719d0488 100644
--- a/editor/libeditor/html/TextEditorTest.cpp
+++ b/editor/libeditor/html/TextEditorTest.cpp
@@ -24,7 +24,7 @@
#include "nsString.h"
#include "nsStringFwd.h"
-#define TEST_RESULT(r) { if (NS_FAILED(r)) {printf("FAILURE result=%X\n", r); return r; } }
+#define TEST_RESULT(r) { if (NS_FAILED(r)) {printf("FAILURE result=%X\n", static_cast(r)); return r; } }
#define TEST_POINTER(p) { if (!p) {printf("FAILURE null pointer\n"); return NS_ERROR_NULL_POINTER; } }
TextEditorTest::TextEditorTest()
diff --git a/editor/libeditor/html/nsHTMLEditor.cpp b/editor/libeditor/html/nsHTMLEditor.cpp
index ea40e22d4d0..e9976ab1fa5 100644
--- a/editor/libeditor/html/nsHTMLEditor.cpp
+++ b/editor/libeditor/html/nsHTMLEditor.cpp
@@ -1228,7 +1228,8 @@ nsHTMLEditor::ReplaceHeadContentsWithHTML(const nsAString& aSourceToInsert)
if (NS_FAILED(res))
{
#ifdef DEBUG
- printf("Couldn't create contextual fragment: error was %d\n", res);
+ printf("Couldn't create contextual fragment: error was %X\n",
+ static_cast(res));
#endif
return res;
}