mirror of
https://github.com/postgres/postgres.git
synced 2025-09-05 02:22:28 +03:00
Message style review
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/variable.c,v 1.45 2008/05/16 15:20:04 petere Exp $ */
|
||||
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/variable.c,v 1.46 2009/01/23 12:43:32 petere Exp $ */
|
||||
|
||||
#include "postgres_fe.h"
|
||||
|
||||
@@ -86,7 +86,7 @@ find_struct_member(char *name, char *str, struct ECPGstruct_member * members, in
|
||||
case '\0': /* found the end, but this time it has to be
|
||||
* an array element */
|
||||
if (members->type->type != ECPGt_array)
|
||||
mmerror(PARSE_ERROR, ET_FATAL, "incorrectly formed variable %s", name);
|
||||
mmerror(PARSE_ERROR, ET_FATAL, "incorrectly formed variable \"%s\"", name);
|
||||
|
||||
switch (members->type->u.element->type)
|
||||
{
|
||||
@@ -109,7 +109,7 @@ find_struct_member(char *name, char *str, struct ECPGstruct_member * members, in
|
||||
return (find_struct_member(name, end, members->type->u.members, brace_level));
|
||||
break;
|
||||
default:
|
||||
mmerror(PARSE_ERROR, ET_FATAL, "incorrectly formed variable %s", name);
|
||||
mmerror(PARSE_ERROR, ET_FATAL, "incorrectly formed variable \"%s\"", name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -132,10 +132,10 @@ find_struct(char *name, char *next, char *end)
|
||||
if (c == '-')
|
||||
{
|
||||
if (p->type->type != ECPGt_array)
|
||||
mmerror(PARSE_ERROR, ET_FATAL, "variable %s is not a pointer", name);
|
||||
mmerror(PARSE_ERROR, ET_FATAL, "variable \"%s\" is not a pointer", name);
|
||||
|
||||
if (p->type->u.element->type != ECPGt_struct && p->type->u.element->type != ECPGt_union)
|
||||
mmerror(PARSE_ERROR, ET_FATAL, "variable %s is not a pointer to a structure or a union", name);
|
||||
mmerror(PARSE_ERROR, ET_FATAL, "variable \"%s\" is not a pointer to a structure or a union", name);
|
||||
|
||||
/* restore the name, we will need it later */
|
||||
*next = c;
|
||||
@@ -147,7 +147,7 @@ find_struct(char *name, char *next, char *end)
|
||||
if (next == end)
|
||||
{
|
||||
if (p->type->type != ECPGt_struct && p->type->type != ECPGt_union)
|
||||
mmerror(PARSE_ERROR, ET_FATAL, "variable %s is neither a structure nor a union", name);
|
||||
mmerror(PARSE_ERROR, ET_FATAL, "variable \"%s\" is neither a structure nor a union", name);
|
||||
|
||||
/* restore the name, we will need it later */
|
||||
*next = c;
|
||||
@@ -157,10 +157,10 @@ find_struct(char *name, char *next, char *end)
|
||||
else
|
||||
{
|
||||
if (p->type->type != ECPGt_array)
|
||||
mmerror(PARSE_ERROR, ET_FATAL, "variable %s is not an array", name);
|
||||
mmerror(PARSE_ERROR, ET_FATAL, "variable \"%s\" is not an array", name);
|
||||
|
||||
if (p->type->u.element->type != ECPGt_struct && p->type->u.element->type != ECPGt_union)
|
||||
mmerror(PARSE_ERROR, ET_FATAL, "variable %s is not a pointer to a structure or a union", name);
|
||||
mmerror(PARSE_ERROR, ET_FATAL, "variable \"%s\" is not a pointer to a structure or a union", name);
|
||||
|
||||
/* restore the name, we will need it later */
|
||||
*next = c;
|
||||
@@ -456,7 +456,7 @@ check_indicator(struct ECPGtype * var)
|
||||
check_indicator(var->u.element);
|
||||
break;
|
||||
default:
|
||||
mmerror(PARSE_ERROR, ET_ERROR, "indicator variable must be integer type");
|
||||
mmerror(PARSE_ERROR, ET_ERROR, "indicator variable must have an integer type");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -468,7 +468,7 @@ get_typedef(char *name)
|
||||
|
||||
for (this = types; this && strcmp(this->name, name); this = this->next);
|
||||
if (!this)
|
||||
mmerror(PARSE_ERROR, ET_FATAL, "invalid datatype \"%s\"", name);
|
||||
mmerror(PARSE_ERROR, ET_FATAL, "unrecognized data type name \"%s\"", name);
|
||||
|
||||
return (this);
|
||||
}
|
||||
@@ -479,7 +479,7 @@ adjust_array(enum ECPGttype type_enum, char **dimension, char **length, char *ty
|
||||
if (atoi(type_index) >= 0)
|
||||
{
|
||||
if (atoi(*length) >= 0)
|
||||
mmerror(PARSE_ERROR, ET_FATAL, "no multidimensional array support");
|
||||
mmerror(PARSE_ERROR, ET_FATAL, "multidimensional arrays are not supported");
|
||||
|
||||
*length = type_index;
|
||||
}
|
||||
@@ -487,7 +487,7 @@ adjust_array(enum ECPGttype type_enum, char **dimension, char **length, char *ty
|
||||
if (atoi(type_dimension) >= 0)
|
||||
{
|
||||
if (atoi(*dimension) >= 0 && atoi(*length) >= 0)
|
||||
mmerror(PARSE_ERROR, ET_FATAL, "no multidimensional array support");
|
||||
mmerror(PARSE_ERROR, ET_FATAL, "multidimensional arrays are not supported");
|
||||
|
||||
if (atoi(*dimension) >= 0)
|
||||
*length = *dimension;
|
||||
@@ -496,16 +496,16 @@ adjust_array(enum ECPGttype type_enum, char **dimension, char **length, char *ty
|
||||
}
|
||||
|
||||
if (pointer_len > 2)
|
||||
mmerror(PARSE_ERROR, ET_FATAL, "no multilevel (more than 2) pointer supported %d", pointer_len);
|
||||
mmerror(PARSE_ERROR, ET_FATAL, "multilevel pointers (more than 2 levels) are not supported; found %d levels", pointer_len);
|
||||
|
||||
if (pointer_len > 1 && type_enum != ECPGt_char && type_enum != ECPGt_unsigned_char)
|
||||
mmerror(PARSE_ERROR, ET_FATAL, "no pointer to pointer supported for this type");
|
||||
mmerror(PARSE_ERROR, ET_FATAL, "pointer to pointer is not supported for this data type");
|
||||
|
||||
if (pointer_len > 1 && (atoi(*length) >= 0 || atoi(*dimension) >= 0))
|
||||
mmerror(PARSE_ERROR, ET_FATAL, "no multidimensional array support");
|
||||
mmerror(PARSE_ERROR, ET_FATAL, "multidimensional arrays are not supported");
|
||||
|
||||
if (atoi(*length) >= 0 && atoi(*dimension) >= 0 && pointer_len)
|
||||
mmerror(PARSE_ERROR, ET_FATAL, "no multidimensional array support");
|
||||
mmerror(PARSE_ERROR, ET_FATAL, "multidimensional arrays are not supported");
|
||||
|
||||
switch (type_enum)
|
||||
{
|
||||
@@ -519,7 +519,7 @@ adjust_array(enum ECPGttype type_enum, char **dimension, char **length, char *ty
|
||||
}
|
||||
|
||||
if (atoi(*length) >= 0)
|
||||
mmerror(PARSE_ERROR, ET_FATAL, "no multidimensional array support for structures");
|
||||
mmerror(PARSE_ERROR, ET_FATAL, "multidimensional arrays for structures are not supported");
|
||||
|
||||
break;
|
||||
case ECPGt_varchar:
|
||||
@@ -579,7 +579,7 @@ adjust_array(enum ECPGttype type_enum, char **dimension, char **length, char *ty
|
||||
}
|
||||
|
||||
if (atoi(*length) >= 0)
|
||||
mmerror(PARSE_ERROR, ET_FATAL, "no multidimensional array support for simple data types");
|
||||
mmerror(PARSE_ERROR, ET_FATAL, "multidimensional arrays for simple data types are not supported");
|
||||
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user