start:
while (DE_LEN() > 0)//lex any directory entries in our stack
{
- if (lexer_lexfile(DE_POP()->d_name) == 0)
+ if (lexer_lexfile((uint8_t*)DE_POP()->d_name) == 0)
FAIL("Lexer failed to tokenize [%s]\n",(*DE_STACKB)->d_name);
}
if (TK_EMPTY) //if there are no tokens,
{ static uint8_t current_path[FPATH_MAX];
static uint8_t const* last_filename;
if ((!last_filename || last_filename != current_filename) &&
- ((uint8_t*) realpath(current_filename, current_path) != (uint8_t*) current_path))
+ ((uint8_t*) realpath((char*)current_filename, (char*)current_path) != (uint8_t*) current_path))
{ perror("realpath: ");
return NULL;
}
int scanner_scanpixels(int*,int);
/* Private */
extern //lexer.c
-int lexer_lexstring(const uint8_t*);
+int lexer_lexstring(const char*);
extern //lexer.c
void lexer_pushtok(int, int);
static
struct dirent* lexer_direntpa[], **lexer_direntpp;
extern //SRC_DIR/bin/tools/apc.c
const char* cargs['Z'];
-#ifndef DL_STACKSIZE
#define DL_STACKSIZE 64
-#endif
-#ifndef DL_CD_STACKSIZE
#define DL_CD_STACKSIZE DL_STACKSIZE //square tree
-#endif
+
static
struct dirlist
{ DIR* dirp;
#define DL_CD_STACK ((*DL_STACKP).child_directory_stack)
#define DL_CD_STACKP ((*DL_STACKP).cds)
#define DL_CURDIR() ((*DL_STACKP).dirp)
-#define DL_LEN() (DL_STACKP - DL_STACK)
-#define DL_CD_LEN() (DL_CD_STACKP - DL_CD_STACK)
+#define DL_LEN() ((int)(DL_STACKP - DL_STACK))
+#define DL_CD_LEN() ((int)(DL_CD_STACKP - DL_CD_STACK))
#define DL_INIT() (DL_STACKP = DL_STACK)
#define DL_CD_INIT() (DL_CD_STACKP = DL_CD_STACK)
#define DL_POP() ((*DL_STACKP--).dirp)
*/
int scanner
#define $($)#$ //stringifier
-#define ERR_CHILD "Fatal: Maximum of " $(DL_CD_STACKSIZE) \
- " child directories exceeded for directory at depth %i\n" \
- ,DL_LEN()
-#define ERR_DEPTH "Fatal: Maximum directory depth of " $(DL_STACKSIZE) \
+#define ERR_CHILD "Fatal: Maximum of " $(DL_CD_STACKSIZE) " child " \
+ "directories exceeded for directory at depth %i\n",DL_LEN()
+#define ERR_DEPTH "Fatal: Maximum directory depth of " $(DL_STACKSIZE) \
" exceeded during directory scan\n"
-#define ERR_DL "Fatal: Directory List Stack Corruption %x\n", DL_LEN()
+#define ERR_DL "Fatal: Directory List Stack Corruption %i\n", DL_LEN()
()
{ int ntok = 0;
scan:
( int* buf,
int max_len
)
-{ static int col_len, row_len, row;
+{ static int /*col_len,*/ row_len = 0, row;
//Open the current file if not yet open
if (current_open_file == NULL)
{ if ((current_open_file = fopen(DL_CD_CURNAME(),"rb")) == NULL)
#define DPS_LEN() (lexer_direntpp - lexer_direntpa)
#define DPS_PUSH(E) (*lexer_direntpp++ = E)
()
-{ struct dirent** direntpp = lexer_direntpa;
- DIR* cwd = DL_CURDIR();
- struct dirent* direntp;
+{ DIR* cwd = DL_CURDIR();
+ struct dirent* direntp;
DL_CD_INIT();
scan_next:
if ((direntp = readdir(cwd)) != NULL)