summaryrefslogtreecommitdiff
path: root/form/fld_def.c
diff options
context:
space:
mode:
Diffstat (limited to 'form/fld_def.c')
-rw-r--r--form/fld_def.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/form/fld_def.c b/form/fld_def.c
index 51bdc6485800..5251bfbef807 100644
--- a/form/fld_def.c
+++ b/form/fld_def.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020,2021 Thomas E. Dickey *
+ * Copyright 2020-2021,2024 Thomas E. Dickey *
* Copyright 1998-2012,2014 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -33,7 +33,7 @@
#include "form.priv.h"
-MODULE_ID("$Id: fld_def.c,v 1.44 2021/03/27 23:49:53 tom Exp $")
+MODULE_ID("$Id: fld_def.c,v 1.46 2024/12/07 21:56:21 tom Exp $")
/* this can't be readonly */
static FIELD default_field =
@@ -87,14 +87,14 @@ _nc_Make_Argument(const FIELDTYPE *typ, va_list *ap, int *err)
{
TypeArgument *res = (TypeArgument *)0;
- if (typ != 0 && (typ->status & _HAS_ARGS) != 0)
+ if (typ != NULL && (typ->status & _HAS_ARGS) != 0)
{
assert(err != 0 && ap != (va_list *)0);
if ((typ->status & _LINKED_TYPE) != 0)
{
TypeArgument *p = typeMalloc(TypeArgument, 1);
- if (p != 0)
+ if (p != NULL)
{
p->left = _nc_Make_Argument(typ->left, ap, err);
p->right = _nc_Make_Argument(typ->right, ap, err);
@@ -134,14 +134,14 @@ _nc_Copy_Argument(const FIELDTYPE *typ, const TypeArgument *argp, int *err)
{
TypeArgument *res = (TypeArgument *)0;
- if (typ != 0 && (typ->status & _HAS_ARGS) != 0)
+ if (typ != NULL && (typ->status & _HAS_ARGS) != 0)
{
assert(err != 0 && argp != 0);
if ((typ->status & _LINKED_TYPE) != 0)
{
TypeArgument *p = typeMalloc(TypeArgument, 1);
- if (p != 0)
+ if (p != NULL)
{
p->left = _nc_Copy_Argument(typ, argp->left, err);
p->right = _nc_Copy_Argument(typ, argp->right, err);
@@ -180,11 +180,11 @@ _nc_Copy_Argument(const FIELDTYPE *typ, const TypeArgument *argp, int *err)
FORM_EXPORT(void)
_nc_Free_Argument(const FIELDTYPE *typ, TypeArgument *argp)
{
- if (typ != 0 && (typ->status & _HAS_ARGS) != 0)
+ if (typ != NULL && (typ->status & _HAS_ARGS) != 0)
{
if ((typ->status & _LINKED_TYPE) != 0)
{
- if (argp != 0)
+ if (argp != NULL)
{
_nc_Free_Argument(typ->left, argp->left);
_nc_Free_Argument(typ->right, argp->right);
@@ -229,7 +229,7 @@ _nc_Copy_Type(FIELD *dst, FIELD const *src)
}
else
{
- if (dst->type != 0)
+ if (dst->type != NULL)
{
dst->type->ref++;
}
@@ -249,7 +249,7 @@ FORM_EXPORT(void)
_nc_Free_Type(FIELD *field)
{
assert(field != 0);
- if (field->type != 0)
+ if (field->type != NULL)
{
field->type->ref--;
_nc_Free_Argument(field->type, (TypeArgument *)(field->arg));
@@ -289,7 +289,7 @@ new_field(int rows, int cols, int frow, int fcol, int nrow, int nbuf)
nrow >= 0 &&
nbuf >= 0 &&
((err = E_SYSTEM_ERROR) != 0) && /* trick: this resets the default error */
- (New_Field = typeMalloc(FIELD, 1)) != 0)
+ (New_Field = typeMalloc(FIELD, 1)) != NULL)
{
T((T_CREATE("field %p"), (void *)New_Field));
*New_Field = default_field;
@@ -313,7 +313,7 @@ new_field(int rows, int cols, int frow, int fcol, int nrow, int nbuf)
size_t len;
len = Total_Buffer_Size(New_Field);
- if ((New_Field->buf = (FIELD_CELL *)malloc(len)))
+ if ((New_Field->buf = (FIELD_CELL *)malloc(len)) != NULL)
{
/* Prefill buffers with blanks and insert terminating zeroes
between buffers */
@@ -360,13 +360,13 @@ free_field(FIELD *field)
{
RETURN(E_BAD_ARGUMENT);
}
- else if (field->form != 0)
+ else if (field->form != NULL)
{
RETURN(E_CONNECTED);
}
else if (field == field->link)
{
- if (field->buf != 0)
+ if (field->buf != NULL)
free(field->buf);
}
else
@@ -380,7 +380,7 @@ free_field(FIELD *field)
}
_nc_Free_Type(field);
#if USE_WIDEC_SUPPORT
- if (field->expanded != 0)
+ if (field->expanded != NULL)
{
int n;