Major header reworking, this respects the namespaces properly. Makes object dependency more obvious, allows for better make caches, and prevents misuse of library features, i.e use con_* instead of printf.

This commit is contained in:
Dale Weiler 2013-06-04 02:47:07 +00:00
parent b2348e1de0
commit 11179a2a71
17 changed files with 43 additions and 19 deletions

1
ast.c
View file

@ -21,7 +21,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

1
code.c
View file

@ -21,6 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include <string.h>
#include "gmqcc.h"
/*

View file

@ -21,7 +21,6 @@
* SOFTWARE.
*/
#include "gmqcc.h"
#include <stdio.h>
/*
* isatty/STDERR_FILENO/STDOUT_FILNO

View file

@ -21,6 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include <string.h>
#include "gmqcc.h"
/*

1
exec.c
View file

@ -26,6 +26,7 @@
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include <stdlib.h>
#include "gmqcc.h"

View file

@ -22,7 +22,10 @@
* SOFTWARE.
*/
#include <time.h>
#include <string.h>
#include <stdlib.h>
#include <sys/stat.h>
#include "gmqcc.h"
#include "lexer.h"

View file

@ -23,12 +23,8 @@
*/
#ifndef GMQCC_HDR
#define GMQCC_HDR
#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
#include <ctype.h>
#include <stdio.h> /* TODO: remove this */
/*
* Disable some over protective warnings in visual studio because fixing them is a waste

1
ir.c
View file

@ -23,6 +23,7 @@
*/
#include <stdlib.h>
#include <string.h>
#include "gmqcc.h"
#include "ir.h"

View file

@ -20,14 +20,12 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <stdarg.h>
#include <stdlib.h>
#include "gmqcc.h"
#include "lexer.h"
/*
* List of Keywords
*/

View file

@ -22,7 +22,6 @@
*/
#ifndef GMQCC_LEXER_HDR
#define GMQCC_LEXER_HDR
typedef struct token_s token;
struct token_s {

8
main.c
View file

@ -21,9 +21,15 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "gmqcc.h"
#include "lexer.h"
#include <time.h>
/* TODO: cleanup this whole file .. it's a fuckign mess */

5
opts.c
View file

@ -21,7 +21,12 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include "gmqcc.h"
unsigned int opts_optimizationcount[COUNT_OPTIMIZATIONS];
opts_cmd_t opts; /* command lien options */

3
pak.c
View file

@ -20,6 +20,9 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include <string.h>
#include <stdlib.h>
#include "gmqcc.h"
/*

View file

@ -21,8 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <math.h>
#include "gmqcc.h"

11
stat.c
View file

@ -1,3 +1,7 @@
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include "gmqcc.h"
/*
@ -22,6 +26,12 @@ typedef struct {
size_t value;
} stat_size_entry_t, **stat_size_table_t;
typedef struct {
uint64_t used;
uint64_t type;
uint64_t size;
} stat_entry_t;
static uint64_t stat_mem_allocated = 0;
static uint64_t stat_mem_deallocated = 0;
static uint64_t stat_mem_allocated_total = 0;
@ -37,7 +47,6 @@ static stat_size_table_t stat_size_vectors = NULL;
static stat_size_table_t stat_size_hashtables = NULL;
static stat_mem_block_t *stat_mem_block_root = NULL;
/*
* A tiny size_t key-value hashtbale for tracking vector and hashtable
* sizes. We can use it for other things too, if we need to. This is

5
test.c
View file

@ -20,10 +20,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include "gmqcc.h"
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "gmqcc.h"
opts_cmd_t opts;
static const char *task_bins[] = {

5
util.c
View file

@ -21,8 +21,9 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include <stdarg.h>
#include <errno.h>
#include <string.h>
#include <ctype.h>
#include "gmqcc.h"
void util_debug(const char *area, const char *ms, ...) {