mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
compile-time assertion in net_db uses constant expressions
* libguile/net_db.c: Use constant expressions for EAI_BADFLAGS and AI_ALL representations.
This commit is contained in:
parent
3429770095
commit
6ef437665c
1 changed files with 2 additions and 2 deletions
|
@ -457,7 +457,7 @@ SCM_DEFINE (scm_setserv, "setserv", 0, 1, 0,
|
||||||
SCM_SYMBOL (sym_getaddrinfo_error, "getaddrinfo-error");
|
SCM_SYMBOL (sym_getaddrinfo_error, "getaddrinfo-error");
|
||||||
|
|
||||||
/* Make sure the `AI_*' flags can be stored as INUMs. */
|
/* Make sure the `AI_*' flags can be stored as INUMs. */
|
||||||
verify (SCM_I_INUM (SCM_I_MAKINUM (AI_ALL)) == AI_ALL);
|
verify (AI_ALL < SCM_MOST_POSITIVE_FIXNUM);
|
||||||
|
|
||||||
/* Valid values for the `ai_flags' to `struct addrinfo'. */
|
/* Valid values for the `ai_flags' to `struct addrinfo'. */
|
||||||
SCM_VARIABLE_INIT (sym_ai_passive, "AI_PASSIVE",
|
SCM_VARIABLE_INIT (sym_ai_passive, "AI_PASSIVE",
|
||||||
|
@ -677,7 +677,7 @@ SCM_DEFINE (scm_getaddrinfo, "getaddrinfo", 1, 5, 0,
|
||||||
#undef FUNC_NAME
|
#undef FUNC_NAME
|
||||||
|
|
||||||
/* Make sure the `EAI_*' flags can be stored as INUMs. */
|
/* Make sure the `EAI_*' flags can be stored as INUMs. */
|
||||||
verify (SCM_I_INUM (SCM_I_MAKINUM (EAI_BADFLAGS)) == EAI_BADFLAGS);
|
verify (EAI_BADFLAGS < SCM_MOST_POSITIVE_FIXNUM);
|
||||||
|
|
||||||
/* Error codes returned by `getaddrinfo'. */
|
/* Error codes returned by `getaddrinfo'. */
|
||||||
SCM_VARIABLE_INIT (sym_eai_badflags, "EAI_BADFLAGS",
|
SCM_VARIABLE_INIT (sym_eai_badflags, "EAI_BADFLAGS",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue