summaryrefslogtreecommitdiff
path: root/form/form.priv.h
diff options
context:
space:
mode:
Diffstat (limited to 'form/form.priv.h')
-rw-r--r--form/form.priv.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/form/form.priv.h b/form/form.priv.h
index ad5af63ad807..57f92eb03164 100644
--- a/form/form.priv.h
+++ b/form/form.priv.h
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018-2021,2024 Thomas E. Dickey *
+ * Copyright 2018-2024,2025 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -31,7 +31,7 @@
* Author: Juergen Pfeifer, 1995,1997 *
****************************************************************************/
-/* $Id: form.priv.h,v 0.49 2024/02/24 12:17:31 tom Exp $ */
+/* $Id: form.priv.h,v 0.52 2025/11/01 20:16:03 tom Exp $ */
#ifndef FORM_PRIV_H
#define FORM_PRIV_H 1
@@ -93,11 +93,11 @@ extern FORM_EXPORT_VAR(FIELDTYPE *) _nc_Default_FieldType;
/* If form is NULL replace form argument by default-form */
#define Normalize_Form(form) \
- ((form) = (form != 0) ? (form) : _nc_Default_Form)
+ ((form) = (form != NULL) ? (form) : _nc_Default_Form)
/* If field is NULL replace field argument by default-field */
#define Normalize_Field(field) \
- ((field) = (field != 0) ? (field) : _nc_Default_Field)
+ ((field) = (field != NULL) ? (field) : _nc_Default_Field)
#if NCURSES_SP_FUNCS
#define Get_Form_Screen(form) \
@@ -172,6 +172,9 @@ TypeArgument;
#define C_ZEROS '\0'
+#define MAX_DIGITS 64
+#define MaxDigits(n) ((n) > MAX_DIGITS ? MAX_DIGITS : ((n) > 0 ? (n) : 0))
+
extern FORM_EXPORT(TypeArgument *) _nc_Make_Argument (const FIELDTYPE*, va_list*, int*);
extern FORM_EXPORT(TypeArgument *) _nc_Copy_Argument (const FIELDTYPE*, const TypeArgument*, int*);
extern FORM_EXPORT(void) _nc_Free_Argument (const FIELDTYPE*, TypeArgument*);
@@ -260,7 +263,7 @@ extern FORM_EXPORT(Form_Hook) _nc_retrace_form_hook (Form_Hook);
int len; \
int n; \
wchar_t *list = _nc_Widen_String((char *)buffer, &len); \
- if (list != 0) \
+ if (list != NULL) \
{ \
result = TRUE; \
for (n = 0; n < len; ++n) \
@@ -278,7 +281,7 @@ extern FORM_EXPORT(Form_Hook) _nc_retrace_form_hook (Form_Hook);
blank = TRUE; \
result = (n + 1 >= width); \
} \
- else if (!ccheck(list[n], NULL)) \
+ else if (!ccheck((int) list[n], NULL)) \
{ \
result = FALSE; \
break; \