explicit casts, add includes
This commit is contained in:
parent
97fbbaaf8f
commit
011ee0f3eb
|
@ -1,4 +1,5 @@
|
|||
/* */
|
||||
#include <math.h>
|
||||
#include "../interpreter.h"
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/* */
|
||||
#include <stdbool.h>
|
||||
#include "../interpreter.h"
|
||||
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
/* */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include "../interpreter.h"
|
||||
|
||||
#define MAX_FORMAT 80
|
||||
#define MAX_SCANF_ARGS 10
|
||||
#define MAX_FORMAT (80)
|
||||
#define MAX_SCANF_ARGS (10)
|
||||
|
||||
static int Stdio_ZeroValue = 0;
|
||||
static int EOFValue = EOF;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/* */
|
||||
#include <stdlib.h>
|
||||
#include "../interpreter.h"
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/* */
|
||||
#include <string.h>
|
||||
#include "../interpreter.h"
|
||||
|
||||
|
||||
|
@ -176,13 +177,13 @@ void StringStrxfrm(struct ParseState *Parser, struct Value *ReturnValue,
|
|||
void StringStrdup(struct ParseState *Parser, struct Value *ReturnValue,
|
||||
struct Value **Param, int NumArgs)
|
||||
{
|
||||
ReturnValue->Val->Pointer = strdup(Param[0]->Val->Pointer);
|
||||
ReturnValue->Val->Pointer = (void*)strdup(Param[0]->Val->Pointer);
|
||||
}
|
||||
|
||||
void StringStrtok_r(struct ParseState *Parser, struct Value *ReturnValue,
|
||||
struct Value **Param, int NumArgs)
|
||||
{
|
||||
ReturnValue->Val->Pointer = strtok_r(Param[0]->Val->Pointer,
|
||||
ReturnValue->Val->Pointer = (void*)strtok_r(Param[0]->Val->Pointer,
|
||||
Param[1]->Val->Pointer, Param[2]->Val->Pointer);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -82,7 +82,7 @@ void StdStrptime(struct ParseState *Parser, struct Value *ReturnValue,
|
|||
void StdGmtime_r(struct ParseState *Parser, struct Value *ReturnValue,
|
||||
struct Value **Param, int NumArgs)
|
||||
{
|
||||
ReturnValue->Val->Pointer = gmtime_r(Param[0]->Val->Pointer,
|
||||
ReturnValue->Val->Pointer = (void*)gmtime_r(Param[0]->Val->Pointer,
|
||||
Param[1]->Val->Pointer);
|
||||
}
|
||||
|
||||
|
|
|
@ -192,7 +192,7 @@ void UnistdGetpagesize(struct ParseState *Parser, struct Value *ReturnValue,
|
|||
void UnistdGetpass(struct ParseState *Parser, struct Value *ReturnValue,
|
||||
struct Value **Param, int NumArgs)
|
||||
{
|
||||
ReturnValue->Val->Pointer = getpass(Param[0]->Val->Pointer);
|
||||
ReturnValue->Val->Pointer = (void*)getpass(Param[0]->Val->Pointer);
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
|
|
@ -749,7 +749,7 @@ void ExpressionPrefixOperator(struct ParseState *Parser,
|
|||
/* pointer prefix arithmetic */
|
||||
int Size = TypeSize(TopValue->Typ->FromType, 0, true);
|
||||
struct Value *StackValue;
|
||||
void *ResultPtr;
|
||||
void *ResultPtr = 0;
|
||||
if (Op != TokenUnaryNot && TopValue->Val->Pointer == NULL)
|
||||
ProgramFail(Parser, "a. invalid use of a NULL pointer");
|
||||
if (!TopValue->IsLValue)
|
||||
|
|
14
lex.c
14
lex.c
|
@ -54,13 +54,13 @@ struct ReservedWord {
|
|||
|
||||
static struct ReservedWord ReservedWords[] = {
|
||||
/* wrf, when optimizations are set escaping certain chars is required or they disappear */
|
||||
{"\#define", TokenHashDefine},
|
||||
{"\#else", TokenHashElse},
|
||||
{"\#endif", TokenHashEndif},
|
||||
{"\#if", TokenHashIf},
|
||||
{"\#ifdef", TokenHashIfdef},
|
||||
{"\#ifndef", TokenHashIfndef},
|
||||
{"\#include", TokenHashInclude},
|
||||
{"#define", TokenHashDefine},
|
||||
{"#else", TokenHashElse},
|
||||
{"#endif", TokenHashEndif},
|
||||
{"#if", TokenHashIf},
|
||||
{"#ifdef", TokenHashIfdef},
|
||||
{"#ifndef", TokenHashIfndef},
|
||||
{"#include", TokenHashInclude},
|
||||
{"auto", TokenAutoType},
|
||||
{"break", TokenBreak},
|
||||
{"case", TokenCase},
|
||||
|
|
2
picoc.h
2
picoc.h
|
@ -6,7 +6,7 @@
|
|||
|
||||
/* picoc version number */
|
||||
#ifdef VER
|
||||
/* VER is the git hash number, obtained via the Makefile */
|
||||
/* VER, the git hash number, and TAG are obtained via the Makefile */
|
||||
#define PICOC_VERSION TAG " r" VER
|
||||
#else
|
||||
#define PICOC_VERSION "v2.2"
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
#define ALIGN_TYPE double
|
||||
#else
|
||||
/* the default data type to use for alignment */
|
||||
#define ALIGN_TYPE void *
|
||||
#define ALIGN_TYPE void*
|
||||
#endif
|
||||
|
||||
#define GLOBAL_TABLE_SIZE (97) /* global variable table */
|
||||
|
|
Loading…
Reference in a new issue