X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fweight.c;h=9128bc3e90038b2f44bb33e0df94528144ea5195;hb=64f58bbdab17e4a09b725e713f4f82f567f44076;hp=642a2b736fdd69b304d56c4ac163400b39b8bdcd;hpb=3a7fba81ceae5b049d0f7d671e9e3c3c43bbf703;p=pspp-builds.git diff --git a/src/weight.c b/src/weight.c index 642a2b73..9128bc3e 100644 --- a/src/weight.c +++ b/src/weight.c @@ -14,24 +14,21 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. */ #include -#include +#include "error.h" #include #include "command.h" +#include "dictionary.h" #include "error.h" #include "lexer.h" #include "str.h" #include "var.h" -/* Notes: - - If the weighting variable is deleted somehow (for instance by - end-of-scope of TEMPORARY), weighting must be canceled. - - Scratch vars may not be used for weighting. */ +#include "gettext.h" +#define _(msgid) gettext (msgid) /* WEIGHT transformation. */ struct weight_trns @@ -44,8 +41,6 @@ struct weight_trns int cmd_weight (void) { - lex_match_id ("WEIGHT"); - if (lex_match_id ("OFF")) dict_set_weight (default_dict, NULL); else @@ -61,7 +56,7 @@ cmd_weight (void) msg (SE, _("The weighting variable must be numeric.")); return CMD_FAILURE; } - if (v->name[0] == '#') + if (dict_class_from_id (v->name) == DC_SCRATCH) { msg (SE, _("The weighting variable may not be scratch.")); return CMD_FAILURE;