projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed intialization of coefficients
[pspp]
/
src
/
language
/
expressions
/
helpers.c
diff --git
a/src/language/expressions/helpers.c
b/src/language/expressions/helpers.c
index ff1621479505e151cabb289cdd97d2d80ed9962d..bddc71269f3c65b2fd070bb271667e0ff2e8b783 100644
(file)
--- a/
src/language/expressions/helpers.c
+++ b/
src/language/expressions/helpers.c
@@
-5,23
+5,21
@@
#include <libpspp/pool.h>
#include "private.h"
#include <libpspp/pool.h>
#include "private.h"
-const struct
fixed_
string empty_string = {NULL, 0};
+const struct
sub
string empty_string = {NULL, 0};
static void
expr_error (void *aux UNUSED, const char *format, ...)
{
static void
expr_error (void *aux UNUSED, const char *format, ...)
{
- struct
error e
;
+ struct
msg m
;
va_list args;
va_list args;
- /* FIXME: we can do better about saying where the error
- occurred. */
- e.class = SE;
- err_location (&e.where);
- e.title = NULL;
-
+ m.category = MSG_SYNTAX;
+ m.severity = MSG_ERROR;
va_start (args, format);
va_start (args, format);
-
err_vmsg (&e,
format, args);
+
m.text = xvasprintf (
format, args);
va_end (args);
va_end (args);
+
+ msg_emit (&m);
}
double
}
double
@@
-120,7
+118,7
@@
expr_yrmoda (double year, double month, double day)
}
int
}
int
-compare_string (const struct
fixed_string *a, const struct fixed_
string *b)
+compare_string (const struct
substring *a, const struct sub
string *b)
{
size_t i;
{
size_t i;
@@
-148,19
+146,19
@@
count_valid (double *d, size_t d_cnt)
return valid_cnt;
}
return valid_cnt;
}
-struct
fixed_
string
+struct
sub
string
alloc_string (struct expression *e, size_t length)
{
alloc_string (struct expression *e, size_t length)
{
- struct
fixed_
string s;
+ struct
sub
string s;
s.length = length;
s.string = pool_alloc (e->eval_pool, length);
return s;
}
s.length = length;
s.string = pool_alloc (e->eval_pool, length);
return s;
}
-struct
fixed_
string
+struct
sub
string
copy_string (struct expression *e, const char *old, size_t length)
{
copy_string (struct expression *e, const char *old, size_t length)
{
- struct
fixed_
string s = alloc_string (e, length);
+ struct
sub
string s = alloc_string (e, length);
memcpy (s.string, old, length);
return s;
}
memcpy (s.string, old, length);
return s;
}