summaryrefslogtreecommitdiff
path: root/fitz/base_object.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2011-09-21 17:29:51 +0200
committerTor Andersson <tor.andersson@artifex.com>2011-09-21 17:29:51 +0200
commitf783c31203be2dbd7a28c89557014f97a367bec9 (patch)
tree8faea8d21fa44b99226af34a13f33c6a0e1f7182 /fitz/base_object.c
parentaa7668835afffd5a2a496a60ed6edb672f5af1a7 (diff)
downloadmupdf-f783c31203be2dbd7a28c89557014f97a367bec9.tar.xz
Add warning context.
Diffstat (limited to 'fitz/base_object.c')
-rw-r--r--fitz/base_object.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/fitz/base_object.c b/fitz/base_object.c
index fd8339a4..fae4b1b4 100644
--- a/fitz/base_object.c
+++ b/fitz/base_object.c
@@ -404,7 +404,7 @@ fz_copy_array(fz_context *ctx, fz_obj *obj)
int n;
if (fz_is_indirect(obj) || !fz_is_array(obj))
- fz_warn("assert: not an array (%s)", fz_objkindstr(obj));
+ fz_warn(obj->ctx, "assert: not an array (%s)", fz_objkindstr(obj));
new = fz_new_array(ctx, fz_array_len(obj));
n = fz_array_len(obj);
@@ -443,11 +443,11 @@ fz_array_put(fz_obj *obj, int i, fz_obj *item)
obj = fz_resolve_indirect(obj);
if (!fz_is_array(obj))
- fz_warn("assert: not an array (%s)", fz_objkindstr(obj));
+ fz_warn(obj->ctx, "assert: not an array (%s)", fz_objkindstr(obj));
else if (i < 0)
- fz_warn("assert: index %d < 0", i);
+ fz_warn(obj->ctx, "assert: index %d < 0", i);
else if (i >= obj->u.a.len)
- fz_warn("assert: index %d > length %d", i, obj->u.a.len);
+ fz_warn(obj->ctx, "assert: index %d > length %d", i, obj->u.a.len);
else
{
if (obj->u.a.items[i])
@@ -462,7 +462,7 @@ fz_array_push(fz_obj *obj, fz_obj *item)
obj = fz_resolve_indirect(obj);
if (!fz_is_array(obj))
- fz_warn("assert: not an array (%s)", fz_objkindstr(obj));
+ fz_warn(obj->ctx, "assert: not an array (%s)", fz_objkindstr(obj));
else
{
if (obj->u.a.len + 1 > obj->u.a.cap)
@@ -484,7 +484,7 @@ fz_array_insert(fz_obj *obj, fz_obj *item)
obj = fz_resolve_indirect(obj);
if (!fz_is_array(obj))
- fz_warn("assert: not an array (%s)", fz_objkindstr(obj));
+ fz_warn(obj->ctx, "assert: not an array (%s)", fz_objkindstr(obj));
else
{
if (obj->u.a.len + 1 > obj->u.a.cap)
@@ -542,7 +542,7 @@ fz_copy_dict(fz_context *ctx, fz_obj *obj)
int i, n;
if (fz_is_indirect(obj) || !fz_is_dict(obj))
- fz_error_make("assert: not a dict (%s)", fz_objkindstr(obj));
+ fz_warn(ctx, "assert: not a dict (%s)", fz_objkindstr(obj));
n = fz_dict_len(obj);
new = fz_new_dict(ctx, n);
@@ -665,7 +665,7 @@ fz_dict_put(fz_obj *obj, fz_obj *key, fz_obj *val)
if (!fz_is_dict(obj))
{
- fz_warn("assert: not a dict (%s)", fz_objkindstr(obj));
+ fz_warn(obj->ctx, "assert: not a dict (%s)", fz_objkindstr(obj));
return;
}
@@ -673,13 +673,13 @@ fz_dict_put(fz_obj *obj, fz_obj *key, fz_obj *val)
s = fz_to_name(key);
else
{
- fz_warn("assert: key is not a name (%s)", fz_objkindstr(obj));
+ fz_warn(obj->ctx, "assert: key is not a name (%s)", fz_objkindstr(obj));
return;
}
if (!val)
{
- fz_warn("assert: val does not exist for key (%s)", s);
+ fz_warn(obj->ctx, "assert: val does not exist for key (%s)", s);
return;
}
@@ -726,7 +726,7 @@ fz_dict_dels(fz_obj *obj, char *key)
obj = fz_resolve_indirect(obj);
if (!fz_is_dict(obj))
- fz_warn("assert: not a dict (%s)", fz_objkindstr(obj));
+ fz_warn(obj->ctx, "assert: not a dict (%s)", fz_objkindstr(obj));
else
{
int i = fz_dict_finds(obj, key);
@@ -747,7 +747,7 @@ fz_dict_del(fz_obj *obj, fz_obj *key)
if (fz_is_name(key))
fz_dict_dels(obj, fz_to_name(key));
else
- fz_warn("assert: key is not a name (%s)", fz_objkindstr(obj));
+ fz_warn(obj->ctx, "assert: key is not a name (%s)", fz_objkindstr(obj));
}
void