projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge commit 'origin/stable'
[pspp-builds.git]
/
src
/
language
/
expressions
/
operations.def
diff --git
a/src/language/expressions/operations.def
b/src/language/expressions/operations.def
index ea640e18e194a27aa1d99cd6676eb495417186e7..d283867214811ea142d83cafd39d9b69faf2a0a0 100644
(file)
--- a/
src/language/expressions/operations.def
+++ b/
src/language/expressions/operations.def
@@
-1,7
+1,7
@@
// -*- c -*-
//
// PSPP - a program for statistical analysis.
// -*- c -*-
//
// PSPP - a program for statistical analysis.
-// Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+// Copyright (C) 2005, 2006
, 2009
Free Software Foundation, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@
-573,7
+573,7
@@
string function RTRIM (string s, string c)
function NUMBER (string s, ni_format f)
{
union value out;
function NUMBER (string s, ni_format f)
{
union value out;
- data_in (ss_head (s, f->w), LEGACY_NATIVE, f->type, f->d, 0, 0, &out, 0);
+ data_in (ss_head (s, f->w), LEGACY_NATIVE, f->type, f->d, 0, 0,
NULL,
&out, 0);
return out.f;
}
return out.f;
}
@@
-582,11
+582,15
@@
absorb_miss string function STRING (x, no_format f)
{
union value v;
struct substring dst;
{
union value v;
struct substring dst;
+ char *s;
v.f = x;
v.f = x;
- dst = alloc_string (e, f->w);
+
assert (!fmt_is_string (f->type));
assert (!fmt_is_string (f->type));
- data_out (&v, f, dst.string);
+ s = data_out (&v, LEGACY_NATIVE, f);
+ dst = alloc_string (e, strlen (s));
+ strcpy (dst.string, s);
+ free (s);
return dst;
}
return dst;
}
@@
-988,7
+992,7
@@
no_opt string operator STR_VAR ()
no_opt perm_only function LAG (num_var v, pos_int n_before)
dataset ds;
{
no_opt perm_only function LAG (num_var v, pos_int n_before)
dataset ds;
{
- struct ccase *c = lagged_case (ds, n_before);
+
const
struct ccase *c = lagged_case (ds, n_before);
if (c != NULL)
{
double x = case_num (c, v);
if (c != NULL)
{
double x = case_num (c, v);
@@
-1001,7
+1005,7
@@
no_opt perm_only function LAG (num_var v, pos_int n_before)
no_opt perm_only function LAG (num_var v)
dataset ds;
{
no_opt perm_only function LAG (num_var v)
dataset ds;
{
- struct ccase *c = lagged_case (ds, 1);
+
const
struct ccase *c = lagged_case (ds, 1);
if (c != NULL)
{
double x = case_num (c, v);
if (c != NULL)
{
double x = case_num (c, v);
@@
-1015,7
+1019,7
@@
no_opt perm_only string function LAG (str_var v, pos_int n_before)
expression e;
dataset ds;
{
expression e;
dataset ds;
{
- struct ccase *c = lagged_case (ds, n_before);
+
const
struct ccase *c = lagged_case (ds, n_before);
if (c != NULL)
return copy_string (e, case_str (c, v), var_get_width (v));
else
if (c != NULL)
return copy_string (e, case_str (c, v), var_get_width (v));
else
@@
-1026,7
+1030,7
@@
no_opt perm_only string function LAG (str_var v)
expression e;
dataset ds;
{
expression e;
dataset ds;
{
- struct ccase *c = lagged_case (ds, 1);
+
const
struct ccase *c = lagged_case (ds, 1);
if (c != NULL)
return copy_string (e, case_str (c, v), var_get_width (v));
else
if (c != NULL)
return copy_string (e, case_str (c, v), var_get_width (v));
else