#include cleanups

This commit is contained in:
rexy712 2021-04-04 09:08:51 -07:00
parent 451e6f2710
commit 47da1d454d
8 changed files with 11 additions and 14 deletions

View File

@ -16,9 +16,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
#include "rjp.h" #include "rjp.h"
#include "rjp_internal.h" #include "rjp_internal.h"
#include "rjp_string.h" #include "rjp_string.h"
@ -26,6 +23,8 @@
#include "rjp_value.h" #include "rjp_value.h"
#include "rjp_array.h" #include "rjp_array.h"
#define __STDC_FORMAT_MACROS
#include <inttypes.h> //PRId64
#include <string.h> //strlen #include <string.h> //strlen
#include <stdio.h> //sprintf #include <stdio.h> //sprintf

View File

@ -22,7 +22,7 @@
#include "rjp_array.h" #include "rjp_array.h"
#include "rjp_value.h" #include "rjp_value.h"
#include <stdlib.h> //free, malloc #include <stdlib.h> //free, malloc, calloc
void* rjp_alloc(RJP_index nbytes){ void* rjp_alloc(RJP_index nbytes){
return malloc(nbytes); return malloc(nbytes);

View File

@ -16,14 +16,13 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <stddef.h>
#include <string.h> //memset
#include "rjp_internal.h" #include "rjp_internal.h"
#include "rjp_array.h" #include "rjp_array.h"
#include "rjp_value.h" #include "rjp_value.h"
#include "rjp_array_element.h" #include "rjp_array_element.h"
#include <string.h> //memset
void irjp_copy_array(RJP_value* dest, const RJP_value* src, const RJP_memory_fns* fns){ void irjp_copy_array(RJP_value* dest, const RJP_value* src, const RJP_memory_fns* fns){
dest->array.elements = dest->array.last = NULL; dest->array.elements = dest->array.last = NULL;
for(RJP_array_element* curr = src->array.elements;curr;curr = curr->next){ for(RJP_array_element* curr = src->array.elements;curr;curr = curr->next){

View File

@ -18,6 +18,7 @@
#include "rjp_lex.h" #include "rjp_lex.h"
#include "rjp.h" #include "rjp.h"
#include <ctype.h> //isalpha, etc #include <ctype.h> //isalpha, etc
#include <string.h> //memcpy #include <string.h> //memcpy

View File

@ -21,7 +21,6 @@
#include "rjp_object.h" #include "rjp_object.h"
#include "rjp_object_member.h" #include "rjp_object_member.h"
#include "rjp_value.h" #include "rjp_value.h"
#include <string.h> //strlen
#include <string.h> //strlen, strncpy #include <string.h> //strlen, strncpy

View File

@ -23,6 +23,7 @@
#include "rjp_value.h" #include "rjp_value.h"
#include "rjp_string.h" #include "rjp_string.h"
#include "rjp_lex.h" #include "rjp_lex.h"
#include <stdlib.h> //strtod, strtol #include <stdlib.h> //strtod, strtol
#include <string.h> //memcpy #include <string.h> //memcpy

View File

@ -16,13 +16,12 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
#include "rjp_internal.h" #include "rjp_internal.h"
#include "rjp_string.h" #include "rjp_string.h"
#include "rjp_value.h" #include "rjp_value.h"
#define __STDC_FORMAT_MACROS
#include <inttypes.h> //PRId64
#include <stdio.h> //fprintf #include <stdio.h> //fprintf
#include <stdint.h> //uintN_t #include <stdint.h> //uintN_t
#include <string.h> //strcpy #include <string.h> //strcpy

View File

@ -18,13 +18,12 @@
#include "tree.h" #include "tree.h"
#include <string.h>
#include <stdio.h>
#include "rjp_string.h" #include "rjp_string.h"
#include "rjp_internal.h" #include "rjp_internal.h"
#include "rjp_value.h" #include "rjp_value.h"
#include <string.h> //memset, strcmp
#define BLACK 0 #define BLACK 0
#define RED 1 #define RED 1