Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions mccode/src/cogen.c.in
Original file line number Diff line number Diff line change
Expand Up @@ -2306,6 +2306,7 @@ int cogen_rt_funnel(struct instr_def *instr)
coutf("#endif // FUNNEL");
coutf("");
printf("\n-----------------------------------------------------------\n");
return(warnings);
} /* cogen_rt_funnel */

/*******************************************************************************
Expand Down Expand Up @@ -2494,7 +2495,7 @@ cogen_header(struct instr_def *instr, char *output_name)
cliter2 = list_iterate(ctypes);
char *cvar;
char *ctpe;
while(cvar = list_next(cliter)) {
while((cvar = list_next(cliter))) {
ctpe = list_next(cliter2);
char *Numberedvar = malloc(256*sizeof(char));
/* We need to attach comp index to cvar */
Expand Down Expand Up @@ -3115,7 +3116,7 @@ void detect_skipable_transforms(struct instr_def *instr) {
// Its target can not be skipped either
struct jump_struct *this_jump;
List_handle literJ = list_iterate(comp->jump);
while (this_jump = list_next(literJ)) {
while ((this_jump = list_next(literJ))) {

// Find target (not initialized yet)
List_handle liter3 = list_iterate(instr->complist);
Expand Down
3 changes: 2 additions & 1 deletion mccode/src/instrument.y
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <math.h>
#include <string.h>
#include <stdio.h>
int yylex(void *yylval);

#include "mccode.h"

Expand Down Expand Up @@ -67,7 +68,7 @@
/* typedef struct List_header * List; */
/* typedef struct Symbol_table * Symtab; */
/* typedef struct instr_def * instr_ptr_t; */
int yylex();
int yylex(void *yylval);
int yyerror(const char *s);
List list_cat(List, List);
Symtab symtab_cat(Symtab, Symtab);
Expand Down
8 changes: 5 additions & 3 deletions mccode/src/list.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ struct List_position
int index; /* Next element to return. */
};

typedef struct List_header *List;
typedef struct List_position *List_handle;
/* Typedefs suppressed, already defined from mccode.h */
/* typedef struct List_header *List;
typedef struct List_position *List_handle; */

/*******************************************************************************
* Create a new list.
Expand Down Expand Up @@ -233,4 +234,5 @@ List list_copy(List from, void * (*copier)(void *)){
list_iterate_end(liter);
}
return to;
}
}

2 changes: 1 addition & 1 deletion mccode/src/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ int strcasecmp(char *s1, char *s2)
#ifndef HAVE_FDOPEN
FILE *fdopen(int descr, const char *mode)
{
fatal_error("The '-' argument for standard input and output is not supported"
fprintf(stderr, "The '-' argument for standard input and output is not supported"
" on this system.");
return(NULL);
}
Expand Down
12 changes: 11 additions & 1 deletion mccode/src/port.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,23 @@
*
*******************************************************************************/

/* Macintosh specific compiler defines. */
/* !!OLD!! Macintosh specific compiler defines. */
#ifdef __dest_os
#if (__dest_os == __mac_os)
#define MAC
#endif
#endif

/* Modern macOS defines */
#ifdef __MACH__
#ifndef HAVE_STRCASECMP
#define HAVE_STRCASECMP HAVE_STRCASECMP
#endif
#ifndef HAVE_STRCASESTR
#define HAVE_STRCASESTR HAVE_STRCASESTR
#endif
#endif

/* File system details. */
#ifndef MC_PATHSEP_C
#ifdef WIN32
Expand Down
4 changes: 2 additions & 2 deletions mccode/src/pygen.c.in
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ int cogen_decls(struct instr_def *instr)
while ((one_component_metadata = symtab_next(component_metadata_handle))) {
coutf(" '%s': {", one_component_metadata->name);
liter = list_iterate(one_component_metadata->val);
while (metadataStruct = list_next(liter)) {
while ((metadataStruct = list_next(liter))) {
coutf(" '%s': ('%s', ", metadataStruct->name, metadataStruct->type);
triple_escaped_lines_out(metadataStruct->lines);
coutf(" ), ");
Expand Down Expand Up @@ -924,7 +924,7 @@ void detect_skipable_transforms(struct instr_def *instr) {
// Its target can not be skipped either
struct jump_struct *this_jump;
List_handle literJ = list_iterate(comp->jump);
while (this_jump = list_next(literJ)) {
while ((this_jump = list_next(literJ))) {

// Find target (not initialized yet)
List_handle liter3 = list_iterate(instr->complist);
Expand Down
Loading