From 02665f6061ac2edd5f22a43ab016067fe6f15d81 Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 7 Feb 2008 01:49:38 +0000 Subject: changes for build with SDCC toolchain git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@657 42af7a65-404d-4744-a932-0658087f49c3 --- misc/pascal/insn16/prun/pexec.c | 4 ++-- misc/pascal/libpas/psignextend16.c | 2 +- misc/pascal/libpoff/Make.defs | 2 +- misc/pascal/libpoff/pflineno.c | 4 +++- misc/pascal/libpoff/pfread.c | 18 ++++++++++-------- misc/pascal/libpoff/pfrrawlineno.c | 2 +- misc/pascal/libpoff/pfrrawreloc.c | 2 +- 7 files changed, 19 insertions(+), 15 deletions(-) diff --git a/misc/pascal/insn16/prun/pexec.c b/misc/pascal/insn16/prun/pexec.c index 0c099d298..10204ae3c 100644 --- a/misc/pascal/insn16/prun/pexec.c +++ b/misc/pascal/insn16/prun/pexec.c @@ -308,7 +308,7 @@ static uint16 pexec_libcall(struct pexec_s *st, uint16 subfunc) ubyte *dest; ubyte *name; int len; - int value; + sint32 value; switch (subfunc) { @@ -599,7 +599,7 @@ static uint16 pexec_libcall(struct pexec_s *st, uint16 subfunc) len = TOS(st, 2); /* Number of bytes in string */ src = (ubyte*)&GETSTACK(st, TOS(st, 3)); /* Pointer to string */ - + /* Make a C string out of the pascal string */ name = pexec_mkcstring(src, len); diff --git a/misc/pascal/libpas/psignextend16.c b/misc/pascal/libpas/psignextend16.c index a89737d2c..fe80691b2 100644 --- a/misc/pascal/libpas/psignextend16.c +++ b/misc/pascal/libpas/psignextend16.c @@ -51,7 +51,7 @@ sint32 signExtend16(uint16 arg16) { - sint32 arg32 = arg16 << 16; + sint32 arg32 = (sint32)arg16 << 16; return arg32 >> 16; } diff --git a/misc/pascal/libpoff/Make.defs b/misc/pascal/libpoff/Make.defs index 67852b705..7de36ec5a 100644 --- a/misc/pascal/libpoff/Make.defs +++ b/misc/pascal/libpoff/Make.defs @@ -45,4 +45,4 @@ POFF_CSRCS = pfhandle.c pfproghandle.c pftprog.c \ pfrelease.c pfdbgcontainer.c pfdbgdiscard.c \ pfxprog.c pfxrodata.c pfiprog.c pfirodata.c \ pfdhdr.c pfdsymbol.c pfdreloc.c pflabel.c \ - pflineno.c pfdbginfo.c pfswap.c + pfdbginfo.c pfswap.c diff --git a/misc/pascal/libpoff/pflineno.c b/misc/pascal/libpoff/pflineno.c index 647194643..95d17723b 100644 --- a/misc/pascal/libpoff/pflineno.c +++ b/misc/pascal/libpoff/pflineno.c @@ -49,6 +49,8 @@ #include "perr.h" /* error() */ #include "pofflib.h" /* POFF library interface */ +poffLibLineNumber_t + /********************************************************************** * Definitions **********************************************************************/ @@ -139,7 +141,7 @@ static void poffAddLineNumberToTable(poffLibLineNumber_t *lineno) /* Save the line number information in the line number table */ - lineNumberTable[nLineNumbers] = *lineno; + memcpy(&lineNumberTable[nLineNumbers], lineno, sizeof(poffLibLineNumber_t)); nLineNumbers++; } diff --git a/misc/pascal/libpoff/pfread.c b/misc/pascal/libpoff/pfread.c index 1bcc1618a..e28236e43 100644 --- a/misc/pascal/libpoff/pfread.c +++ b/misc/pascal/libpoff/pfread.c @@ -125,6 +125,7 @@ static uint16 poffReadSectionHeaders(poffHandle_t handle, FILE *poffFile) { poffInfo_t *poffInfo = (poffInfo_t*)handle; poffSectionHeader_t sectionHeader; + poffSectionHeader_t *dest; long offset; size_t entriesRead; int i; @@ -159,38 +160,39 @@ static uint16 poffReadSectionHeaders(poffHandle_t handle, FILE *poffFile) { case SHT_PROGDATA : /* Program data */ if ((sectionHeader.sh_flags & SHF_EXEC) != 0) - poffInfo->progSection = sectionHeader; + dest = &poffInfo->progSection; else - poffInfo->roDataSection = sectionHeader; + dest = &poffInfo->roDataSection; break; case SHT_SYMTAB : /* Symbol table */ - poffInfo->symbolTableSection = sectionHeader; + dest = &poffInfo->symbolTableSection; break; case SHT_STRTAB : /* String table */ - poffInfo->stringTableSection = sectionHeader; + dest = &poffInfo->stringTableSection; break; case SHT_REL : /* Relocation data */ - poffInfo->relocSection = sectionHeader; + dest = &poffInfo->relocSection; break; case SHT_FILETAB : /* File table */ - poffInfo->fileNameTableSection = sectionHeader; + dest = &poffInfo->fileNameTableSection; break; case SHT_LINENO : /* Line number data */ - poffInfo->lineNumberSection = sectionHeader; + dest = &poffInfo->lineNumberSection; break; case SHT_DEBUG : /* Debug function info data */ - poffInfo->debugFuncSection = sectionHeader; + dest = &poffInfo->debugFuncSection; break; default: return ePOFFREADERROR; } + memcpy(dest, §ionHeader, sizeof(poffSectionHeader_t)); /* Get the offset to the next section */ diff --git a/misc/pascal/libpoff/pfrrawlineno.c b/misc/pascal/libpoff/pfrrawlineno.c index 7d3aa1ab0..6eb137157 100644 --- a/misc/pascal/libpoff/pfrrawlineno.c +++ b/misc/pascal/libpoff/pfrrawlineno.c @@ -98,7 +98,7 @@ sint32 poffGetRawLineNumber(poffHandle_t handle, poffLineNumber_t *lineno) { /* Copy the raw line number information to the user */ - *lineno = *(poffLineNumber_t*)&poffInfo->lineNumberTable[lineNumberIndex]; + memcpy(lineno, &poffInfo->lineNumberTable[lineNumberIndex], sizeof(poffLineNumber_t)); /* Set up for the next read */ diff --git a/misc/pascal/libpoff/pfrrawreloc.c b/misc/pascal/libpoff/pfrrawreloc.c index 143830d4e..2a3e6d7d5 100644 --- a/misc/pascal/libpoff/pfrrawreloc.c +++ b/misc/pascal/libpoff/pfrrawreloc.c @@ -95,7 +95,7 @@ sint32 poffGetRawRelocation(poffHandle_t handle, poffRelocation_t *lineno) { /* Copy the raw line number information to the user */ - *lineno = *(poffRelocation_t*)&poffInfo->relocTable[relocIndex]; + memcpy(lineno, &poffInfo->relocTable[relocIndex], sizeof(poffRelocation_t)); /* Set up for the next read */ -- cgit v1.2.3