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 <config.h>
#include <stdlib.h>
-#include <assert.h>
+#include "error.h"
#include "alloc.h"
#include "command.h"
+#include "dictionary.h"
#include "error.h"
#include "hash.h"
#include "lexer.h"
#include "str.h"
#include "var.h"
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
+
/* The code for this function is very similar to the code for the
RENAME subcommand of MODIFY VARS. */
int
{
struct variable **rename_vars = NULL;
char **rename_new_names = NULL;
- int rename_cnt = 0;
+ size_t rename_cnt = 0;
char *err_name;
int status = CMD_FAILURE;
- int i;
-
if (temporary != 0)
{
msg (SE, _("RENAME VARS may not be used after TEMPORARY. "
cancel_temporary ();
}
- lex_match_id ("RENAME");
- lex_match_id ("VARIABLES");
-
do
{
- int prev_nv_1 = rename_cnt;
- int prev_nv_2 = rename_cnt;
+ size_t prev_nv_1 = rename_cnt;
+ size_t prev_nv_2 = rename_cnt;
if (!lex_match ('('))
{
goto lossage;
if (prev_nv_1 != rename_cnt)
{
+ size_t i;
+
msg (SE, _("Differing number of variables in old name list "
- "(%d) and in new name list (%d)."),
- rename_cnt - prev_nv_2, prev_nv_1 - prev_nv_2);
+ "(%u) and in new name list (%u)."),
+ (unsigned) rename_cnt - prev_nv_2,
+ (unsigned) prev_nv_1 - prev_nv_2);
for (i = 0; i < prev_nv_1; i++)
free (rename_new_names[i]);
free (rename_new_names);
free (rename_vars);
if (rename_new_names != NULL)
{
+ size_t i;
for (i = 0; i < rename_cnt; i++)
free (rename_new_names[i]);
free (rename_new_names);