general cleanups. Removed lots of unused code and redundant error checks

This commit is contained in:
Francesco Cozzuto
2022-08-24 16:46:32 +02:00
parent 71e8a9e4cb
commit cd74dda4a9
29 changed files with 333 additions and 813 deletions
+4 -4
View File
@@ -54,11 +54,11 @@ _Bool Object_IsFile(Object *obj)
return obj->type == &t_file;
}
FILE *Object_ToStream(Object *obj, Error *error)
FILE *Object_GetStream(Object *obj)
{
if(!Object_IsFile(obj))
{
Error_Report(error, 0, "Object is not a file");
if(!Object_IsDir(obj)) {
Error_Panic("%s expected a file object, but an %s "
"was provided", __func__, Object_GetName(obj));
return NULL;
}