OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*******************************************************************************/
-#include "php_psi_stdinc.h"
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#else
+# include "php_config.h"
+#endif
#include "data.h"
+#include "debug.h"
typedef bool (*psi_validate_list_entry)(struct psi_validate_scope *scope,
struct psi_data *dst, void *ptr);
{
struct psi_decl_arg *def = ptr;
- PSI_DEBUG_PRINT(dst, "typedef %s", def->var->name);
+ PSI_DEBUG_PRINT(dst, "typedef %s", def->var->name->val);
return psi_decl_arg_validate_typedef(dst, def, scope);
}
{
struct psi_decl_struct *str = ptr;
- PSI_DEBUG_PRINT(dst, "struct %s", str->name);
+ PSI_DEBUG_PRINT(dst, "struct %s", str->name->val);
if (psi_decl_struct_validate(dst, str, scope)) {
PSI_DEBUG_PRINT(dst, "::(%zu, %zu)", str->align, str->size);
return true;
{
struct psi_decl_union *unn = ptr;
- PSI_DEBUG_PRINT(dst, "union %s", unn->name);
+ PSI_DEBUG_PRINT(dst, "union %s", unn->name->val);
if (psi_decl_union_validate(dst, unn, scope)) {
PSI_DEBUG_PRINT(dst, "::(%zu, %zu)", unn->align, unn->size);
return true;
{
struct psi_decl_enum *enm = ptr;
- PSI_DEBUG_PRINT(dst, "enum %s", enm->name);
+ PSI_DEBUG_PRINT(dst, "enum %s", enm->name->val);
return psi_decl_enum_validate(dst, enm);
}
{
struct psi_decl_extvar *evar = ptr;
- PSI_DEBUG_PRINT(dst, "extvar %s", evar->arg->var->name);
+ PSI_DEBUG_PRINT(dst, "extvar %s", evar->arg->var->name->val);
if (psi_decl_extvar_validate(dst, evar, scope)) {
dst->decls = psi_plist_add(dst->decls, &evar->getter);
dst->decls = psi_plist_add(dst->decls, &evar->setter);
{
struct psi_decl *decl = ptr;
- PSI_DEBUG_PRINT(dst, "decl %s", decl->func->var->name);
+ PSI_DEBUG_PRINT(dst, "decl %s", decl->func->var->name->val);
return psi_decl_validate(dst, decl, scope);
}
{
struct psi_const *cnst = ptr;
- PSI_DEBUG_PRINT(dst, "constant %s", cnst->name);
+ PSI_DEBUG_PRINT(dst, "constant %s", cnst->name->val);
return psi_const_validate(dst, cnst, scope);
}
{
struct psi_impl *impl = ptr;
- PSI_DEBUG_PRINT(dst, "impl %s", impl->func->name);
+ PSI_DEBUG_PRINT(dst, "impl %s", impl->func->name->val);
return psi_impl_validate(dst, impl, scope);
}
bool psi_validate(struct psi_validate_scope *scope,
struct psi_data *dst, struct psi_data *src)
{
- struct psi_validate_list types = {src->types, &dst->types};
- struct psi_validate_list structs = {src->structs, &dst->structs};
- struct psi_validate_list unions = {src->unions, &dst->unions};
- struct psi_validate_list enums = {src->enums, &dst->enums};
- struct psi_validate_list vars = {src->vars, &dst->vars};
- struct psi_validate_list decls = {src->decls, &dst->decls};
- struct psi_validate_list consts = {src->consts, &dst->consts};
- struct psi_validate_list impls = {src->impls, &dst->impls};
+ struct psi_validate_list types = {src->types, &dst->types, NULL, NULL};
+ struct psi_validate_list structs = {src->structs, &dst->structs, NULL, NULL};
+ struct psi_validate_list unions = {src->unions, &dst->unions, NULL, NULL};
+ struct psi_validate_list enums = {src->enums, &dst->enums, NULL, NULL};
+ struct psi_validate_list vars = {src->vars, &dst->vars, NULL, NULL};
+ struct psi_validate_list decls = {src->decls, &dst->decls, NULL, NULL};
+ struct psi_validate_list consts = {src->consts, &dst->consts, NULL, NULL};
+ struct psi_validate_list impls = {src->impls, &dst->impls, NULL, NULL};
unsigned flags = dst->flags;
size_t check_count = ~0;
}
/* nothing changed; bail out */
- if (count_all && (dst->flags & PSI_SILENT) && !(flags & PSI_SILENT)) {
- /* one last error-spitting round, if not explicitly suppressed */
- dst->flags ^= PSI_SILENT;
- check_count = ~0;
+ if (count_all) {
+ src->errors += count_all;
- PSI_DEBUG_PRINT(dst, "PSI: validation bail out with %zu"
- " type checks remaining, errors follow\n", count_all);
- continue;
+ if ((dst->flags & PSI_SILENT) && !(flags & PSI_SILENT)) {
+ /* one last error-spitting round, if not explicitly suppressed */
+ dst->flags ^= PSI_SILENT;
+ check_count = ~0;
+
+ PSI_DEBUG_PRINT(dst, "PSI: validation bail out with %zu"
+ " type checks remaining, errors follow\n", count_all);
+ continue;
+ }
}
- src->errors += count_all;
break;
}