From ceb551d1a816ab7fd4b068b72d8ae73ac08dcebc Mon Sep 17 00:00:00 2001 From: mattias Date: Mon, 10 Mar 2008 16:43:38 +0000 Subject: [PATCH] codetools: added examples for c const git-svn-id: trunk@14488 - --- components/codetools/examples/h2pastest.lpi | 4 ++-- components/codetools/examples/scanexamples/test.h | 7 +++++++ components/codetools/h2pastool.pas | 2 ++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/components/codetools/examples/h2pastest.lpi b/components/codetools/examples/h2pastest.lpi index 3ff734a652..5563e31114 100644 --- a/components/codetools/examples/h2pastest.lpi +++ b/components/codetools/examples/h2pastest.lpi @@ -26,10 +26,10 @@ - + - + diff --git a/components/codetools/examples/scanexamples/test.h b/components/codetools/examples/scanexamples/test.h index ed91f3c8ea..b981ff4b9f 100644 --- a/components/codetools/examples/scanexamples/test.h +++ b/components/codetools/examples/scanexamples/test.h @@ -141,6 +141,13 @@ unsigned long long unsigned_long_long; #define MACRO_CONCATENATION(a,b) a##b +// const or not const +const char a; // A constant character +char const b; // A constant character (the same) +char *const c; // A constant pointer to a character +const char *const d; // A constant pointer to a constant character +const char *e; // A pointer to a constant character. The pointer may be modified. + #ifdef __cplusplus } #endif diff --git a/components/codetools/h2pastool.pas b/components/codetools/h2pastool.pas index e6abccc7e9..9c1ec76741 100644 --- a/components/codetools/h2pastool.pas +++ b/components/codetools/h2pastool.pas @@ -54,8 +54,10 @@ begin CTool:=TCCodeParserTool.Create; try + // pare C header file CTool.Parse(CCode); CTool.WriteDebugReport; + finally CTool.Free; end;