Merge branch 'master' of git://factorcode.org/git/factor
commit
8be1adebd1
|
@ -13,6 +13,7 @@ void init_signals(void)
|
||||||
void early_init(void) { }
|
void early_init(void) { }
|
||||||
|
|
||||||
#define SUFFIX ".image"
|
#define SUFFIX ".image"
|
||||||
|
#define SUFFIX_LEN 6
|
||||||
|
|
||||||
const char *default_image_path(void)
|
const char *default_image_path(void)
|
||||||
{
|
{
|
||||||
|
@ -21,8 +22,14 @@ const char *default_image_path(void)
|
||||||
if(!path)
|
if(!path)
|
||||||
return "factor.image";
|
return "factor.image";
|
||||||
|
|
||||||
char *new_path = safe_malloc(PATH_MAX + strlen(SUFFIX) + 1);
|
/* We can't call strlen() here because with gcc 4.1.2 this
|
||||||
memcpy(new_path,path,strlen(path) + 1);
|
causes an internal compiler error. */
|
||||||
strcat(new_path,SUFFIX);
|
int len = 0;
|
||||||
|
const char *iter = path;
|
||||||
|
while(*iter) { len++; iter++; }
|
||||||
|
|
||||||
|
char *new_path = safe_malloc(PATH_MAX + SUFFIX_LEN + 1);
|
||||||
|
memcpy(new_path,path,len + 1);
|
||||||
|
memcpy(new_path + len,SUFFIX,SUFFIX_LEN + 1);
|
||||||
return new_path;
|
return new_path;
|
||||||
}
|
}
|
||||||
|
|
|
@ -471,8 +471,6 @@ F_STRING* allot_string_internal(CELL capacity)
|
||||||
string->hashcode = F;
|
string->hashcode = F;
|
||||||
string->aux = F;
|
string->aux = F;
|
||||||
|
|
||||||
set_string_nth(string,capacity,0);
|
|
||||||
|
|
||||||
return string;
|
return string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -645,13 +643,6 @@ F_BYTE_ARRAY *allot_c_string(CELL capacity, CELL size)
|
||||||
} \
|
} \
|
||||||
type *to_##type##_string(F_STRING *s, bool check) \
|
type *to_##type##_string(F_STRING *s, bool check) \
|
||||||
{ \
|
{ \
|
||||||
if(sizeof(type) == sizeof(char)) \
|
|
||||||
{ \
|
|
||||||
if(check && !check_string(s,sizeof(type))) \
|
|
||||||
general_error(ERROR_C_STRING,tag_object(s),F,NULL); \
|
|
||||||
return (type*)(s + 1); \
|
|
||||||
} \
|
|
||||||
else \
|
|
||||||
return (type*)(string_to_##type##_alien(s,check) + 1); \
|
return (type*)(string_to_##type##_alien(s,check) + 1); \
|
||||||
} \
|
} \
|
||||||
type *unbox_##type##_string(void) \
|
type *unbox_##type##_string(void) \
|
||||||
|
|
Loading…
Reference in New Issue