mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Run `indent' on the whole tree
Can't indent the .y files yet, they need special treatment. Signed-off-by: Vegard Nossum <vegard.nossum@gmail.com>
This commit is contained in:
@@ -5,123 +5,114 @@
|
||||
#include "mylink.h"
|
||||
#include "main.h"
|
||||
|
||||
static BBOOL symboldefined( char *name )
|
||||
static BBOOL symboldefined(char *name)
|
||||
{
|
||||
struct sSection *pSect;
|
||||
struct sSection *pSect;
|
||||
|
||||
pSect=pSections;
|
||||
pSect = pSections;
|
||||
|
||||
while( pSect )
|
||||
{
|
||||
ULONG i;
|
||||
while (pSect) {
|
||||
ULONG i;
|
||||
|
||||
for( i=0; i<pSect->nNumberOfSymbols; i+=1 )
|
||||
{
|
||||
if( (pSect->tSymbols[i]->Type==SYM_EXPORT)
|
||||
|| ( (pSect->tSymbols[i]->Type==SYM_LOCAL)
|
||||
&& (pSect==pSect->tSymbols[i]->pSection) ) )
|
||||
{
|
||||
if( strcmp(pSect->tSymbols[i]->pzName,name)==0 )
|
||||
return( 1 );
|
||||
for (i = 0; i < pSect->nNumberOfSymbols; i += 1) {
|
||||
if ((pSect->tSymbols[i]->Type == SYM_EXPORT)
|
||||
|| ((pSect->tSymbols[i]->Type == SYM_LOCAL)
|
||||
&& (pSect == pSect->tSymbols[i]->pSection))) {
|
||||
if (strcmp(pSect->tSymbols[i]->pzName, name) ==
|
||||
0)
|
||||
return (1);
|
||||
}
|
||||
|
||||
}
|
||||
pSect=pSect->pNext;
|
||||
pSect = pSect->pNext;
|
||||
}
|
||||
return( 0 );
|
||||
return (0);
|
||||
}
|
||||
|
||||
static BBOOL addmodulecontaining( char *name )
|
||||
static BBOOL addmodulecontaining(char *name)
|
||||
{
|
||||
struct sSection **ppLSect;
|
||||
struct sSection **ppLSect;
|
||||
|
||||
ppLSect=&pLibSections;
|
||||
ppLSect = &pLibSections;
|
||||
|
||||
while( *ppLSect )
|
||||
{
|
||||
ULONG i;
|
||||
while (*ppLSect) {
|
||||
ULONG i;
|
||||
|
||||
for( i=0; i<(*ppLSect)->nNumberOfSymbols; i+=1 )
|
||||
{
|
||||
if( ((*ppLSect)->tSymbols[i]->Type==SYM_EXPORT)
|
||||
|| ( ((*ppLSect)->tSymbols[i]->Type==SYM_LOCAL)
|
||||
&& ((*ppLSect)==(*ppLSect)->tSymbols[i]->pSection) ) )
|
||||
{
|
||||
if( strcmp((*ppLSect)->tSymbols[i]->pzName,name)==0 )
|
||||
{
|
||||
struct sSection **ppSect;
|
||||
ppSect=&pSections;
|
||||
while( *ppSect )
|
||||
ppSect=&((*ppSect)->pNext);
|
||||
for (i = 0; i < (*ppLSect)->nNumberOfSymbols; i += 1) {
|
||||
if (((*ppLSect)->tSymbols[i]->Type == SYM_EXPORT)
|
||||
|| (((*ppLSect)->tSymbols[i]->Type == SYM_LOCAL)
|
||||
&& ((*ppLSect) ==
|
||||
(*ppLSect)->tSymbols[i]->pSection))) {
|
||||
if (strcmp
|
||||
((*ppLSect)->tSymbols[i]->pzName,
|
||||
name) == 0) {
|
||||
struct sSection **ppSect;
|
||||
ppSect = &pSections;
|
||||
while (*ppSect)
|
||||
ppSect = &((*ppSect)->pNext);
|
||||
|
||||
*ppSect = *ppLSect;
|
||||
*ppLSect = (*ppLSect)->pNext;
|
||||
(*ppSect)->pNext = NULL;
|
||||
return( 1 );
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
ppLSect=&((*ppLSect)->pNext);
|
||||
ppLSect = &((*ppLSect)->pNext);
|
||||
}
|
||||
return( 0 );
|
||||
return (0);
|
||||
}
|
||||
|
||||
void AddNeededModules( void )
|
||||
void AddNeededModules(void)
|
||||
{
|
||||
struct sSection *pSect;
|
||||
struct sSection *pSect;
|
||||
|
||||
if( (options&OPT_SMART_C_LINK)==0 )
|
||||
{
|
||||
struct sSection **ppLSect;
|
||||
if ((options & OPT_SMART_C_LINK) == 0) {
|
||||
struct sSection **ppLSect;
|
||||
|
||||
ppLSect=&pLibSections;
|
||||
ppLSect = &pLibSections;
|
||||
|
||||
while( *ppLSect )
|
||||
{
|
||||
struct sSection **ppSect;
|
||||
ppSect=&pSections;
|
||||
while( *ppSect )
|
||||
ppSect=&((*ppSect)->pNext);
|
||||
while (*ppLSect) {
|
||||
struct sSection **ppSect;
|
||||
ppSect = &pSections;
|
||||
while (*ppSect)
|
||||
ppSect = &((*ppSect)->pNext);
|
||||
|
||||
*ppSect = *ppLSect;
|
||||
*ppLSect = (*ppLSect)->pNext;
|
||||
(*ppSect)->pNext = NULL;
|
||||
|
||||
/*ppLSect=&((*ppLSect)->pNext);*/
|
||||
/*ppLSect=&((*ppLSect)->pNext); */
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if( options&OPT_SMART_C_LINK )
|
||||
{
|
||||
if( !addmodulecontaining( smartlinkstartsymbol ) )
|
||||
{
|
||||
sprintf( temptext, "Can't find start symbol '%s'", smartlinkstartsymbol );
|
||||
fatalerror( temptext );
|
||||
}
|
||||
else
|
||||
printf( "Smart linking with symbol '%s'\n", smartlinkstartsymbol );
|
||||
if (options & OPT_SMART_C_LINK) {
|
||||
if (!addmodulecontaining(smartlinkstartsymbol)) {
|
||||
sprintf(temptext, "Can't find start symbol '%s'",
|
||||
smartlinkstartsymbol);
|
||||
fatalerror(temptext);
|
||||
} else
|
||||
printf("Smart linking with symbol '%s'\n",
|
||||
smartlinkstartsymbol);
|
||||
}
|
||||
|
||||
pSect=pSections;
|
||||
pSect = pSections;
|
||||
|
||||
while( pSect )
|
||||
{
|
||||
ULONG i;
|
||||
while (pSect) {
|
||||
ULONG i;
|
||||
|
||||
for( i=0; i<pSect->nNumberOfSymbols; i+=1 )
|
||||
{
|
||||
if( (pSect->tSymbols[i]->Type==SYM_IMPORT)
|
||||
|| (pSect->tSymbols[i]->Type==SYM_LOCAL) )
|
||||
{
|
||||
if( !symboldefined(pSect->tSymbols[i]->pzName) )
|
||||
{
|
||||
addmodulecontaining( pSect->tSymbols[i]->pzName );
|
||||
for (i = 0; i < pSect->nNumberOfSymbols; i += 1) {
|
||||
if ((pSect->tSymbols[i]->Type == SYM_IMPORT)
|
||||
|| (pSect->tSymbols[i]->Type == SYM_LOCAL)) {
|
||||
if (!symboldefined(pSect->tSymbols[i]->pzName)) {
|
||||
addmodulecontaining(pSect->tSymbols[i]->
|
||||
pzName);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
pSect=pSect->pNext;
|
||||
pSect = pSect->pNext;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user