diff --git a/Makefile b/Makefile index 79f1d3f1..1ed5c8dd 100644 --- a/Makefile +++ b/Makefile @@ -336,7 +336,7 @@ ifeq ($(OS), Windows_NT) @del obj\*.* /S /Q 1> nul 2>&1 @del bin\adept.exe /S /Q 1> nul 2>&1 @del bin\adept_debug.exe /S /Q 1> nul 2>&1 - @del unittests\obj\*.* /S /Q 1> nul 2>&1 + @if exist unittests\obj @del unittests\obj\*.* /S /Q 1> nul 2>&1 else @find . -name "*.o" -type f -delete 2> /dev/null @rm -rf 2> /dev/null bin/adept diff --git a/include/UTIL/ground.h b/include/UTIL/ground.h index 9dfe928d..40f51837 100644 --- a/include/UTIL/ground.h +++ b/include/UTIL/ground.h @@ -19,6 +19,7 @@ extern "C" { #include #include #include +#include #ifdef _WIN32 #include diff --git a/src/AST/ast_layout.c b/src/AST/ast_layout.c index 728e1b40..10a808ff 100644 --- a/src/AST/ast_layout.c +++ b/src/AST/ast_layout.c @@ -286,6 +286,7 @@ bool ast_layout_bone_has_polymorph(ast_layout_bone_t *bone){ default: internalerrorprintf("ast_layout_bone_has_polymorph() got unknown bone kind\n"); } + return false; } strong_cstr_t ast_layout_bone_str(ast_layout_bone_t *bone, ast_field_map_t *field_map, ast_layout_endpoint_t endpoint){ diff --git a/src/INFER/infer.c b/src/INFER/infer.c index e3e88baa..20d7388a 100644 --- a/src/INFER/infer.c +++ b/src/INFER/infer.c @@ -1090,7 +1090,6 @@ errorcode_t infer_type(infer_ctx_t *ctx, ast_type_t *type){ switch(elem->id){ case AST_ELEM_BASE: { weak_cstr_t base = ((ast_elem_base_t*) elem)->base; - ast_composite_t *composite; if(strcmp(base, "void") == 0 && type->elements_length > 1 && e != 0 && type->elements[e - 1]->id == AST_ELEM_POINTER){ // Substitute '*void' with 'ptr' @@ -1132,8 +1131,6 @@ errorcode_t infer_type(infer_ctx_t *ctx, ast_type_t *type){ free(cloned.elements); continue; // Don't do normal stuff that follows } - - composite = ast_composite_find_exact(ctx->ast, base); } break; case AST_ELEM_FUNC: @@ -1143,11 +1140,6 @@ errorcode_t infer_type(infer_ctx_t *ctx, ast_type_t *type){ if(infer_type(ctx, ((ast_elem_func_t*) elem)->return_type)) return FAILURE; break; case AST_ELEM_GENERIC_BASE: { - weak_cstr_t base = ((ast_elem_generic_base_t*) elem)->name; - ast_polymorphic_composite_t *poly_composite; - - poly_composite = ast_polymorphic_composite_find_exact(ctx->ast, base); - for(length_t a = 0; a != ((ast_elem_generic_base_t*) elem)->generics_length; a++){ if(infer_type(ctx, &((ast_elem_generic_base_t*) elem)->generics[a])) return FAILURE; }