Changeset 21916 for trunk/tools
- Timestamp:
- Dec 18, 2011, 10:28:22 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 74 deleted
- 19 edited
- 44 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 1 bin 2 Makefile.inc 1 env.cmd 2 LocalConfig.kmk
-
-
Property svn:mergeinfo
set to
/branches/gcc-kmk merged eligible
- Property svn:ignore
-
trunk/tools/common/kError.cpp
r8003 r21916 16 16 * Header Files * 17 17 *******************************************************************************/ 18 #if defined (__EMX__) && !defined (USE_OS2_TOOLKIT_HEADERS) 19 #define __OS2DEF__ 20 #endif 18 21 #include <os2.h> 22 19 23 #include <string.h> 20 24 #include <stdio.h> -
trunk/tools/common/kFile.cpp
r8003 r21916 19 19 * Header Files * 20 20 *******************************************************************************/ 21 #if defined (__EMX__) && !defined (USE_OS2_TOOLKIT_HEADERS) 22 #define __OS2DEF__ 23 #endif 21 24 #include <os2.h> 22 25 … … 45 48 * @remark 46 49 */ 47 KBOOL kFile::refreshFileStatus() 50 KBOOL kFile::refreshFileStatus() throw (kError) 48 51 { 49 52 if (fStdDev) … … 68 71 * @returns Success indicator. 69 72 */ 70 KBOOL kFile::position() 73 KBOOL kFile::position() throw (kError) 71 74 { 72 75 /* … … 254 257 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no) 255 258 */ 256 kFile::kFile(const char *pszFilename, KBOOL fReadOnly/*=TRUE*/) 259 kFile::kFile(const char *pszFilename, KBOOL fReadOnly/*=TRUE*/) throw (kError) 257 260 : fReadOnly(fReadOnly), 258 261 fStatusClean(FALSE), … … 332 335 * @param cbBuffer Amount of bytes to read. 333 336 */ 334 int kFile::read(void *pvBuffer, long cbBuffer) 337 int kFile::read(void *pvBuffer, long cbBuffer) throw (kError) 335 338 { 336 339 ULONG cbRead; … … 427 430 * @param off Absolute file offset. 428 431 */ 429 int kFile::readAt(void *pvBuffer, long cbBuffer, long off) 432 int kFile::readAt(void *pvBuffer, long cbBuffer, long off) throw (kError) 430 433 { 431 434 if (set(off)) … … 477 480 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no) 478 481 */ 479 int kFile::readln(char *pszBuffer, long cchBuffer) throw(kError)482 int kFile::readln(char *pszBuffer, long cchBuffer) 480 483 { 481 484 long cbRead; … … 558 561 * @param cbBuffer Amount of bytes to write. 559 562 */ 560 int kFile::write(const void *pv, long cb) 563 int kFile::write(const void *pv, long cb) throw (kError) 561 564 { 562 565 if (fReadOnly) … … 678 681 * @param off Absolute file offset. 679 682 */ 680 int kFile::writeAt(const void *pvBuffer, long cbBuffer, long off) 683 int kFile::writeAt(const void *pvBuffer, long cbBuffer, long off) throw (kError) 681 684 { 682 685 if (set(off)) … … 788 791 * @param off Relative reposition. 789 792 */ 790 int kFile::move(long off) 793 int kFile::move(long off) throw (kError) 791 794 { 792 795 if ((off + offVirtual) & 0x80000000UL) /* above 2GB or negative */ … … 814 817 * @param off New file position. 815 818 */ 816 int kFile::set(long off) 819 int kFile::set(long off) throw (kError) 817 820 { 818 821 if (off < 0) … … 839 842 * @remark Will only throw error if refreshFileStatus failes. 840 843 */ 841 int kFile::end() 844 int kFile::end() throw (kError) 842 845 { 843 846 if (!refreshFileStatus()) … … 872 875 * @remark Will only throw error if refreshFileStatus failes. 873 876 */ 874 long kFile::getSize() 877 long kFile::getSize() throw (kError) 875 878 { 876 879 if (!refreshFileStatus()) … … 886 889 * @remark Will only throw error if refreshFileStatus failes. 887 890 */ 888 long kFile::getPos() const 891 long kFile::getPos() const throw (kError) 889 892 { 890 893 return offVirtual; … … 898 901 * @remark Will only throw error if refreshFileStatus failes. 899 902 */ 900 KBOOL kFile::isEOF() 903 KBOOL kFile::isEOF() throw (kError) 901 904 { 902 905 #if 0 … … 954 957 * @remark May throw errors. 955 958 */ 956 void *kFile::mapFile(const char *pszFilename) 959 void *kFile::mapFile(const char *pszFilename) throw (kError) 957 960 { 958 961 kFile file(pszFilename); … … 968 971 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no) 969 972 */ 970 void kFile::mapFree(void *pvFileMapping) 973 void kFile::mapFree(void *pvFileMapping) throw (kError) 971 974 { 972 975 if (pvFileMapping) -
trunk/tools/common/kFileDef.cpp
r9164 r21916 119 119 120 120 121 kFileDef::kFileDef(kFile *pFile) :121 kFileDef::kFileDef(kFile *pFile) throw (kError) : 122 122 kFileFormatBase(pFile), 123 123 pszType(NULL), pszModName(NULL), pszBase(NULL), pszCode(NULL), pszData(NULL), pszDescription(NULL), … … 137 137 * Destructor. Frees used memory. 138 138 */ 139 kFileDef::~kFileDef() 139 kFileDef::~kFileDef() throw (kError) 140 140 { 141 141 if (pszType != NULL) delete pszType; … … 182 182 * @remark throws errorcode on error (TODO: errorhandling) 183 183 */ 184 void kFileDef::read(kFile *pFile) 184 void kFileDef::read(kFile *pFile) throw (kError) 185 185 { 186 186 char *pszTmp; … … 445 445 * @remark tabs are expanded. string is trimmed. comments removed. 446 446 */ 447 char *kFileDef::readln(kFile *pFile, char *pszBuffer, int cbBuffer) 447 char *kFileDef::readln(kFile *pFile, char *pszBuffer, int cbBuffer) throw (kError) 448 448 { 449 449 int i; … … 700 700 * @remark 701 701 */ 702 KBOOL kFileDef::makeWatcomLinkFileAddtion(kFile *pOut, int enmOS) 702 KBOOL kFileDef::makeWatcomLinkFileAddtion(kFile *pOut, int enmOS) throw(kError) 703 703 { 704 704 PDEFSEGMENT pSeg; -
trunk/tools/common/kFileDef.h
r9162 r21916 105 105 /**@cat Constructor/Destructor */ 106 106 kFileDef(kFile *pFile) throw(kError); 107 virtual ~kFileDef() ;107 virtual ~kFileDef() throw (kError); 108 108 109 109 /** @cat Module information methods. */ -
trunk/tools/common/kFileFormatBase.cpp
r8003 r21916 30 30 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no) 31 31 */ 32 kFileFormatBase::kFileFormatBase(kFile *pFile) 32 kFileFormatBase::kFileFormatBase(kFile *pFile) throw (kError) 33 33 : pFile(pFile) 34 34 { … … 42 42 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no) 43 43 */ 44 kFileFormatBase::~kFileFormatBase() 44 kFileFormatBase::~kFileFormatBase() throw (kError) 45 45 { 46 46 if (pFile) -
trunk/tools/common/kFileInterfaces.cpp
r8003 r21916 19 19 * Header Files * 20 20 *******************************************************************************/ 21 #include <malloc.h> 22 21 23 #include "kTypes.h" 22 24 #include "kError.h" … … 63 65 * Save the target we are searching for references to. 64 66 */ 65 PXREFSTATE pState = new XREFSTATE;67 PXREFSTATE pState = (PXREFSTATE)malloc(sizeof(XREFSTATE)); 66 68 pState->ulSegment = ulSegment; 67 69 pState->offSegment = offSegment; … … 131 133 kASSERT(preloc != NULL); 132 134 relocFindClose(preloc); 133 delete preloc->pv2;135 free(preloc->pv2); 134 136 preloc->pv2 = NULL; 135 137 } -
trunk/tools/common/kFileLX.cpp
r8003 r21916 256 256 * @param pszFilename LX executable image name. 257 257 */ 258 kFileLX::kFileLX(const char *pszFilename) :258 kFileLX::kFileLX(const char *pszFilename) throw (kError) : 259 259 kFileFormatBase(NULL), pvBase(NULL) 260 260 { … … 292 292 * @param pFile Pointer to opened LX file. 293 293 */ 294 kFileLX::kFileLX(kFile *pFile) :294 kFileLX::kFileLX(kFile *pFile) throw (kError) : 295 295 kFileFormatBase(pFile), pvBase(NULL) 296 296 { … … 330 330 * Destructor. 331 331 */ 332 kFileLX::~kFileLX() 332 kFileLX::~kFileLX() throw (kError) 333 333 { 334 334 if (pvBase != NULL) … … 412 412 413 413 /* store status - current export entry */ 414 PEXPSTATE pExpState = new EXPSTATE;414 PEXPSTATE pExpState = (PEXPSTATE)malloc(sizeof(EXPSTATE)); 415 415 pExport->pv = pExpState; 416 416 pExpState->pb32 = pBundle; … … 560 560 void kFileLX::exportFindClose(kExportEntry *pExport) 561 561 { 562 delete pExport->pv;562 free(pExport->pv); 563 563 pExport->pv = NULL; 564 564 return; … … 1375 1375 ) 1376 1376 { 1377 PLXRELOCSTATE pState = new LXRELOCSTATE;1377 PLXRELOCSTATE pState = (PLXRELOCSTATE)malloc(sizeof(LXRELOCSTATE)); 1378 1378 pState->ulSegment = ulSegment; 1379 1379 pState->ulPage = paObject[ulSegment].o32_pagemap - 1; … … 1451 1451 if (preloc->isName()) 1452 1452 { 1453 delete (void*)preloc->Info.Name.pszModule;1454 delete (void*)preloc->Info.Name.pszName;1453 delete preloc->Info.Name.pszModule; 1454 delete preloc->Info.Name.pszName; 1455 1455 preloc->Info.Name.pszName = preloc->Info.Name.pszModule = NULL; 1456 1456 } … … 1670 1670 if (preloc->isName()) 1671 1671 { 1672 delete (void*)preloc->Info.Name.pszModule;1673 delete (void*)preloc->Info.Name.pszName;1672 delete preloc->Info.Name.pszModule; 1673 delete preloc->Info.Name.pszName; 1674 1674 preloc->Info.Name.pszName = preloc->Info.Name.pszModule = NULL; 1675 1675 } … … 1677 1677 /* free state info */ 1678 1678 memset(preloc->pv1, 0xff, sizeof(LXRELOCSTATE)); 1679 delete preloc->pv1;1679 free(preloc->pv1); 1680 1680 preloc->pv1 = (void*)0xdeadbeef; 1681 1681 } -
trunk/tools/common/kFileLX.h
r8003 r21916 22 22 kFileLX(const char *pszFilename) throw (kError); 23 23 kFileLX(kFile *pFile) throw (kError); 24 ~kFileLX() ;24 ~kFileLX() throw (kError); 25 25 26 26 /** @cat Module information methods. */ -
trunk/tools/common/kFilePE.cpp
r8003 r21916 11 11 ******************************************************************************/ 12 12 #include <string.h> 13 #include <malloc.h> 13 14 14 15 #include "MZexe.h" … … 36 37 * @remark throws errorcode 37 38 */ 38 kFilePE::kFilePE(kFile *pFile) :39 kFilePE::kFilePE(kFile *pFile) throw (kError) : 39 40 kFileFormatBase(pFile), 40 41 pvBase(NULL), … … 76 77 77 78 /* create mapping */ 78 pvBase = new char [pehdr.OptionalHeader.SizeOfImage];79 pvBase = malloc(pehdr.OptionalHeader.SizeOfImage); 79 80 if (pvBase == NULL) 80 81 throw(kError(kError::NOT_ENOUGH_MEMORY)); … … 93 94 94 95 /* read sections */ 95 for (int i = 0; i < pehdr.FileHeader.NumberOfSections; i++) 96 int i; 97 for (i = 0; i < pehdr.FileHeader.NumberOfSections; i++) 96 98 { 97 99 unsigned long cbSection; … … 138 140 catch (kError err) 139 141 { 140 delete(pvBase);142 free(pvBase); 141 143 pvBase = NULL; 142 144 throw(err); … … 148 150 * Destructor. 149 151 */ 150 kFilePE::~kFilePE() 152 kFilePE::~kFilePE() throw (kError) 151 153 { 152 154 if (pvBase) 153 delete(pvBase);155 free(pvBase); 154 156 } 155 157 -
trunk/tools/common/kFilePE.h
r8003 r21916 67 67 public: 68 68 kFilePE(kFile *pFile) throw (kError); 69 virtual ~kFilePE() ;69 virtual ~kFilePE() throw (kError); 70 70 71 71 /** @cat Module information methods. */ -
trunk/tools/common/kFileSDF.cpp
r8003 r21916 67 67 * 68 68 */ 69 void kFileSDF::parseSDFFile(void *pvFile) 69 void kFileSDF::parseSDFFile(void *pvFile) throw (kError) 70 70 { 71 71 /* … … 160 160 * @remark Will throw error codes. 161 161 */ 162 kFileSDF::kFileSDF(kFile *pFile) :162 kFileSDF::kFileSDF(kFile *pFile) throw (kError) : 163 163 kFileFormatBase(pFile), papStructs(NULL), pHdr(NULL), paTypes(NULL) 164 164 { … … 205 205 206 206 207 kFileSDF::~kFileSDF() 207 kFileSDF::~kFileSDF() throw (kError) 208 208 { 209 209 if (papStructs); -
trunk/tools/common/kFileSDF.h
r8003 r21916 81 81 public: 82 82 kFileSDF(kFile *pFile) throw (kError); 83 ~kFileSDF() ;83 ~kFileSDF() throw (kError); 84 84 85 85 /** @cat Debug Type information methods. */ -
trunk/tools/common/kTypes.h
r21350 r21916 54 54 55 55 /******************************************************************************* 56 * GNU C++ Compilers * 57 *******************************************************************************/ 58 #ifdef __GNUC__ 59 60 #define INLINE static inline 61 #define KLIBCALL _Optlink 62 INLINE void INT3() { __asm__ __volatile__ ("int3\n\tnop"); } 63 64 typedef unsigned long KSIZE; 65 typedef unsigned long KBOOL; 66 67 #endif 68 69 70 /******************************************************************************* 56 71 * Common stuff * 57 72 *******************************************************************************/ … … 183 198 ((expr) ? (void)0 : (kAssertMsg(#expr, __FILE__, __LINE__, __FUNCTION__) ? INT3() : (void)0)) 184 199 200 #ifdef __cplusplus 201 extern "C" 202 #endif 185 203 KBOOL KLIBCALL kAssertMsg(const char *pszExpr, const char *pszFilename, unsigned uLine, const char *pszFunction); 186 204 -
trunk/tools/impdef/ImpDef.cpp
r8002 r21916 14 14 #include <string.h> 15 15 #include <stdlib.h> 16 17 #include <string> 18 #include <set> 16 19 17 20 #include "kTypes.h" … … 186 189 static long processFile(const char *pszInput, const char *pszOutput, const POPTIONS pOptions) 187 190 { 191 std::set<std::string> exports; 192 188 193 long lRc = 0; 189 194 … … 197 202 { 198 203 kFile * pOutput = new kFile(pszOutput, FALSE); 199 kExportEntry exp ort;204 kExportEntry exp; 200 205 201 206 /* generate LIBRARY line */ … … 210 215 211 216 /* Exports */ 212 if (pDefFile->exportFindFirst(&exp ort))217 if (pDefFile->exportFindFirst(&exp)) 213 218 { 214 219 pOutput->printf("EXPORTS\n"); 215 220 do 216 221 { 217 char szName[MAXEXPORTNAME ];222 char szName[MAXEXPORTNAME + 2 /*quotes*/]; 218 223 const char *pszName; 219 224 220 225 /* validate export struct */ 221 if (exp ort.achName[0] == '\0')226 if (exp.achName[0] == '\0') 222 227 { 223 228 kFile::StdErr.printf( 224 229 "Warning export name is missing.\n" 225 230 "info:\texport.achIntName=%s\n\texport.achName=%s\n\texport.ulOrdinal=%ld\n", 226 exp ort.achIntName, export.achName, export.ulOrdinal);231 exp.achIntName, exp.achName, exp.ulOrdinal); 227 232 continue; 228 233 } 229 if (exp ort.ulOrdinal == ~0UL)234 if (exp.ulOrdinal == ~0UL) 230 235 { 231 236 kFile::StdErr.printf( 232 237 "warning: export is missing ordinal value. Export is ignored\n" 233 238 "info:\texport.achIntName=%s\n\texport.achName=%s\n\texport.ulOrdinal=%ld\n", 234 exp ort.achIntName, export.achName, export.ulOrdinal);239 exp.achIntName, exp.achName, exp.ulOrdinal); 235 240 continue; 236 241 } 237 242 238 243 /* real work */ 239 pszName = generateExportName(&export, &szName[0], pOptions); 240 241 pOutput->printf(" %-*s @%ld\n", 40, pszName, export.ulOrdinal); 242 } while (pDefFile->exportFindNext(&export)); 244 pszName = generateExportName(&exp, &szName[1], pOptions); 245 if (exports.count(pszName) == 0) { 246 exports.insert(pszName); 247 szName[0] = '"'; 248 strcat(szName, "\""); 249 pszName = szName; 250 251 pOutput->printf(" %-*s @%ld\n", 40, pszName, exp.ulOrdinal); 252 } 253 } while (pDefFile->exportFindNext(&exp)); 243 254 pOutput->setSize(); 244 255 delete pOutput; -
trunk/tools/install/odininst.cpp
r21679 r21916 47 47 #include "debugtools.h" 48 48 #include <odininst.h> 49 #include <win \options.h>49 #include <win/options.h> 50 50 #include <versionos2.h> 51 51 #include <time.h> -
trunk/tools/regedit/regapi.c
r21535 r21916 24 24 #define PASCAL WIN32API 25 25 26 #ifndef __GNUC__ 26 27 static char *strsep(char **string, char *token) 27 28 { … … 38 39 return ret; 39 40 } 41 #endif 40 42 41 43 typedef HRESULT (* __stdcall lpfnDLLRegProc)(void); -
trunk/tools/wrc/newstruc.c
r6110 r21916 744 744 /* FIXME: This relies in sizeof(DWORD) == sizeof(pointer_type) */ 745 745 if((DWORD)rtp & 1) 746 #if !defined(__IBMC__) 747 ((char *)rtp)++; 748 #else 749 rtp = (riff_tag_t*)((char*)rtp + 1); 750 #endif 746 rtp = (riff_tag_t*)((char*)rtp + 1); 751 747 } 752 748 } … … 859 855 /* FIXME: This relies in sizeof(DWORD) == sizeof(pointer_type) */ 860 856 if((DWORD)rtp & 1) 861 #if !defined(__IBMC__) 862 ((char *)rtp)++; 863 #else 864 rtp = (riff_tag_t*)((char*)rtp + 1); 865 #endif 857 rtp = (riff_tag_t*)((char*)rtp + 1); 866 858 } 867 859 -
trunk/tools/wrc/wrc.c
r21589 r21916 261 261 resource_t *resource_top; /* The top of the parsed resources */ 262 262 263 #ifdef __EMX__ 264 int getopt (int argc, char **argv, const char *optstring); 265 #else 266 int getopt (int argc, char *const *argv, const char *optstring); 263 #ifndef __GNUC__ 264 int getopt(int argc, char *const *argv, const char *optstring); 267 265 #endif 268 266
Note:
See TracChangeset
for help on using the changeset viewer.