[ros-diffs] [rharabien] 56076: [FREELDR] - Try to fix release build

rharabien at svn.reactos.org rharabien at svn.reactos.org
Wed Mar 7 13:47:38 UTC 2012


Author: rharabien
Date: Wed Mar  7 13:47:38 2012
New Revision: 56076

URL: http://svn.reactos.org/svn/reactos?rev=56076&view=rev
Log:
[FREELDR]
- Try to fix release build

Modified:
    trunk/reactos/boot/freeldr/freeldr/debug.c
    trunk/reactos/boot/freeldr/freeldr/include/debug.h

Modified: trunk/reactos/boot/freeldr/freeldr/debug.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/debug.c?rev=56076&r1=56075&r2=56076&view=diff
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/debug.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/debug.c [iso-8859-1] Wed Mar  7 13:47:38 2012
@@ -254,92 +254,6 @@
 		DbgPrint("\n");
 	}
 }
-
-#else
-
-ULONG
-DbgPrint(PCCH Format, ...)
-{
-    return 0;
-}
-
-#endif // DBG
-
-ULONG
-MsgBoxPrint(const char *Format, ...)
-{
-	va_list ap;
-	CHAR Buffer[512];
-	ULONG Length;
-
-	va_start(ap, Format);
-
-	/* Construct a string */
-	Length = _vsnprintf(Buffer, 512, Format, ap);
-
-	/* Check if we went past the buffer */
-	if (Length == MAXULONG)
-	{
-		/* Terminate it if we went over-board */
-		Buffer[sizeof(Buffer) - 1] = '\n';
-
-		/* Put maximum */
-		Length = sizeof(Buffer);
-	}
-
-	/* Show it as a message box */
-	UiMessageBox(Buffer);
-
-	/* Cleanup and exit */
-	va_end(ap);
-	return 0;
-}
-
-//DECLSPEC_NORETURN
-VOID
-NTAPI
-KeBugCheckEx(
-    IN ULONG  BugCheckCode,
-    IN ULONG_PTR  BugCheckParameter1,
-    IN ULONG_PTR  BugCheckParameter2,
-    IN ULONG_PTR  BugCheckParameter3,
-    IN ULONG_PTR  BugCheckParameter4)
-{
-    char Buffer[70];
-    sprintf(Buffer, "*** STOP: 0x%08lX (0x%08lX, 0x%08lX, 0x%08lX, 0x%08lX)",
-        BugCheckCode, BugCheckParameter1, BugCheckParameter2,
-        BugCheckParameter3, BugCheckParameter4);
-    UiMessageBoxCritical(Buffer);
-    assert(FALSE);
-    for (;;);
-}
-
-VOID
-NTAPI
-RtlAssert(IN PVOID FailedAssertion,
-          IN PVOID FileName,
-          IN ULONG LineNumber,
-          IN PCHAR Message OPTIONAL)
-{
-   if (Message)
-   {
-      DbgPrint("Assertion \'%s\' failed at %s line %d: %s\n",
-               (PCHAR)FailedAssertion,
-               (PCHAR)FileName,
-               LineNumber,
-               Message);
-   }
-   else
-   {
-      DbgPrint("Assertion \'%s\' failed at %s line %d\n",
-               (PCHAR)FailedAssertion,
-               (PCHAR)FileName,
-               LineNumber);
-   }
-
-   DbgBreakPoint();
-}
-
 
 static BOOLEAN
 DbgAddDebugChannel( CHAR* channel, CHAR* level, CHAR op)
@@ -398,7 +312,7 @@
     return TRUE;
 }
 
-BOOLEAN
+VOID
 DbgParseDebugChannels(PCHAR Value)
 {
     CHAR *str, *separator, *c, op;
@@ -425,8 +339,90 @@
         }
 
         str = separator + 1;
-    }while(separator != NULL);
-
-    return TRUE;
-}
-
+    } while(separator != NULL);
+}
+
+#else
+
+ULONG
+DbgPrint(PCCH Format, ...)
+{
+    return 0;
+}
+
+#endif // DBG
+
+ULONG
+MsgBoxPrint(const char *Format, ...)
+{
+	va_list ap;
+	CHAR Buffer[512];
+	ULONG Length;
+
+	va_start(ap, Format);
+
+	/* Construct a string */
+	Length = _vsnprintf(Buffer, 512, Format, ap);
+
+	/* Check if we went past the buffer */
+	if (Length == MAXULONG)
+	{
+		/* Terminate it if we went over-board */
+		Buffer[sizeof(Buffer) - 1] = '\n';
+
+		/* Put maximum */
+		Length = sizeof(Buffer);
+	}
+
+	/* Show it as a message box */
+	UiMessageBox(Buffer);
+
+	/* Cleanup and exit */
+	va_end(ap);
+	return 0;
+}
+
+//DECLSPEC_NORETURN
+VOID
+NTAPI
+KeBugCheckEx(
+    IN ULONG  BugCheckCode,
+    IN ULONG_PTR  BugCheckParameter1,
+    IN ULONG_PTR  BugCheckParameter2,
+    IN ULONG_PTR  BugCheckParameter3,
+    IN ULONG_PTR  BugCheckParameter4)
+{
+    char Buffer[70];
+    sprintf(Buffer, "*** STOP: 0x%08lX (0x%08lX, 0x%08lX, 0x%08lX, 0x%08lX)",
+        BugCheckCode, BugCheckParameter1, BugCheckParameter2,
+        BugCheckParameter3, BugCheckParameter4);
+    UiMessageBoxCritical(Buffer);
+    assert(FALSE);
+    for (;;);
+}
+
+VOID
+NTAPI
+RtlAssert(IN PVOID FailedAssertion,
+          IN PVOID FileName,
+          IN ULONG LineNumber,
+          IN PCHAR Message OPTIONAL)
+{
+   if (Message)
+   {
+      DbgPrint("Assertion \'%s\' failed at %s line %d: %s\n",
+               (PCHAR)FailedAssertion,
+               (PCHAR)FileName,
+               LineNumber,
+               Message);
+   }
+   else
+   {
+      DbgPrint("Assertion \'%s\' failed at %s line %d\n",
+               (PCHAR)FailedAssertion,
+               (PCHAR)FileName,
+               LineNumber);
+   }
+
+   DbgBreakPoint();
+}

Modified: trunk/reactos/boot/freeldr/freeldr/include/debug.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/include/debug.h?rev=56076&r1=56075&r2=56076&view=diff
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/include/debug.h [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/include/debug.h [iso-8859-1] Wed Mar  7 13:47:38 2012
@@ -38,14 +38,13 @@
 #define DPRINT_HEAP         15  // messages in a bottle
 #define DBG_CHANNELS_COUNT  16
 
-BOOLEAN DbgParseDebugChannels(PCHAR Value);
-
 #if DBG && !defined(_M_ARM)
 
 	VOID	DebugInit(VOID);
     ULONG   DbgPrint(const char *Format, ...);
     VOID    DbgPrint2(ULONG Mask, ULONG Level, const char *File, ULONG Line, char *Format, ...);
 	VOID	DebugDumpBuffer(ULONG Mask, PVOID Buffer, ULONG Length);
+	VOID    DbgParseDebugChannels(PCHAR Value);
 
     #define ERR_LEVEL      0x1
     #define FIXME_LEVEL    0x2
@@ -117,6 +116,7 @@
 	#define DebugInit()
 	#define BugCheck(fmt, ...)
 	#define DbgDumpBuffer(mask, buf, len)
+	#define DbgParseDebugChannels(val)
 
 #endif // DBG
 




More information about the Ros-diffs mailing list