bunch of fixes for YAP's own IO

This commit is contained in:
Vítor Santos Costa
2015-07-22 19:33:30 -05:00
parent 91d6faabc1
commit f3b84af062
20 changed files with 191 additions and 128 deletions

View File

@@ -81,7 +81,7 @@ chtype(Int ch)
#define ParserAuxSp LOCAL_ScannerStack
/* routines in parser.c */
VarEntry *Yap_LookupVar(char *);
VarEntry *Yap_LookupVar(const char *);
Term Yap_VarNames(VarEntry *,Term);
Term Yap_Variables(VarEntry *,Term);
Term Yap_Singletons(VarEntry *,Term);
@@ -178,17 +178,17 @@ void Yap_init_socks(char *host, long interface_port);
extern int errno;
#endif
INLINE_ONLY EXTERN UInt inline HashFunction(unsigned char *);
INLINE_ONLY EXTERN UInt inline HashFunction(const char *);
INLINE_ONLY EXTERN UInt inline WideHashFunction(wchar_t *);
INLINE_ONLY EXTERN inline UInt
HashFunction(unsigned char *CHP)
HashFunction(const char *CHP)
{
/* djb2 */
UInt hash = 5381;
UInt c;
while ((c = *CHP++) != '\0') {
while ((c = (UInt)(*CHP++)) != '\0') {
/* hash = ((hash << 5) + hash) + c; hash * 33 + c */
hash = hash * 33 ^ c;
}