cvsuser 04/11/05 00:46:03
Modified: charset ascii.c ascii.h binary.c binary.h iso-8859-1.c
iso-8859-1.h
encodings fixed_8.c
Log:
make it compile
* renamed r?index to cs_r?index (gcc 2.95.3 lib conflict with string.h)
* moved decl in front of statement (C89)
Revision Changes Path
1.4 +7 -7 parrot/charset/ascii.c
Index: ascii.c
===================================================================
RCS file: /cvs/public/parrot/charset/ascii.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ascii.c 3 Nov 2004 23:43:05 -0000 1.3
+++ ascii.c 5 Nov 2004 08:46:02 -0000 1.4
@@ -1,6 +1,6 @@
/*
Copyright: 2004 The Perl Foundation. All Rights Reserved.
-$Id: ascii.c,v 1.3 2004/11/03 23:43:05 dan Exp $
+$Id: ascii.c,v 1.4 2004/11/05 08:46:02 leo Exp $
=head1 NAME
@@ -127,11 +127,11 @@
return 0;
}
-static INTVAL index(Interp *interpreter, STRING *source_string, STRING
*search_string, UINTVAL offset) {
+static INTVAL cs_index(Interp *interpreter, STRING *source_string, STRING
*search_string, UINTVAL offset) {
return -1;
}
-static INTVAL rindex(Interp *interpreter, STRING *source_string, STRING
*search_string, UINTVAL offset) {
+static INTVAL cs_rindex(Interp *interpreter, STRING *source_string, STRING
*search_string, UINTVAL offset) {
return -1;
}
@@ -223,8 +223,8 @@
downcase_first,
titlecase_first,
compare,
- index,
- rindex,
+ cs_index,
+ cs_rindex,
validate,
is_wordchar,
find_wordchar,
@@ -245,10 +245,10 @@
};
preferred_encoding = Parrot_load_encoding(interpreter, "fixed_8");
-
+
memcpy(return_set, &base_set, sizeof(CHARSET));
return return_set;
-
+
}
/*
1.4 +3 -3 parrot/charset/ascii.h
Index: ascii.h
===================================================================
RCS file: /cvs/public/parrot/charset/ascii.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ascii.h 4 Nov 2004 18:01:24 -0000 1.3
+++ ascii.h 5 Nov 2004 08:46:02 -0000 1.4
@@ -1,7 +1,7 @@
/* ascii.h
* Copyright: 2004 The Perl Foundation. All Rights Reserved.
* CVS Info
- * $Id: ascii.h,v 1.3 2004/11/04 18:01:24 dan Exp $
+ * $Id: ascii.h,v 1.4 2004/11/05 08:46:02 leo Exp $
* Overview:
* This is the header for the ascii charset functions
* Data Structure and Algorithms:
@@ -27,8 +27,8 @@
static void downcase_first(Interp *interpreter, STRING *source_string);
static void titlecase_first(Interp *interpreter, STRING *source_string);
static INTVAL compare(Interp *interpreter, STRING *lhs, STRING *rhs);
-static INTVAL index(Interp *interpreter, STRING *source_string, STRING
*search_string, UINTVAL offset);
-static INTVAL rindex(Interp *interpreter, STRING *source_string, STRING
*search_string, UINTVAL offset);
+static INTVAL cs_index(Interp *interpreter, STRING *source_string, STRING
*search_string, UINTVAL offset);
+static INTVAL cs_rindex(Interp *interpreter, STRING *source_string, STRING
*search_string, UINTVAL offset);
static UINTVAL validate(Interp *interpreter, STRING *source_string);
static INTVAL is_wordchar(Interp *interpreter, STRING *source_string, UINTVAL
offset);
static INTVAL find_wordchar(Interp *interpreter, STRING *source_string, UINTVAL
offset);
1.5 +7 -7 parrot/charset/binary.c
Index: binary.c
===================================================================
RCS file: /cvs/public/parrot/charset/binary.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- binary.c 3 Nov 2004 21:44:37 -0000 1.4
+++ binary.c 5 Nov 2004 08:46:02 -0000 1.5
@@ -1,6 +1,6 @@
/*
Copyright: 2004 The Perl Foundation. All Rights Reserved.
-$Id: binary.c,v 1.4 2004/11/03 21:44:37 dan Exp $
+$Id: binary.c,v 1.5 2004/11/05 08:46:02 leo Exp $
=head1 NAME
@@ -79,11 +79,11 @@
return 0;
}
-static INTVAL index(Interp *interpreter, STRING *source_string, STRING
*search_string, UINTVAL offset) {
+static INTVAL cs_index(Interp *interpreter, STRING *source_string, STRING
*search_string, UINTVAL offset) {
return -1;
}
-static INTVAL rindex(Interp *interpreter, STRING *source_string, STRING
*search_string, UINTVAL offset) {
+static INTVAL cs_rindex(Interp *interpreter, STRING *source_string, STRING
*search_string, UINTVAL offset) {
return -1;
}
@@ -175,8 +175,8 @@
downcase_first,
titlecase_first,
compare,
- index,
- rindex,
+ cs_index,
+ cs_rindex,
validate,
is_wordchar,
find_wordchar,
@@ -197,10 +197,10 @@
};
preferred_encoding = Parrot_load_encoding(interpreter, "fixed_8");
-
+
memcpy(return_set, &base_set, sizeof(CHARSET));
return return_set;
-
+
}
/*
1.3 +3 -3 parrot/charset/binary.h
Index: binary.h
===================================================================
RCS file: /cvs/public/parrot/charset/binary.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- binary.h 3 Nov 2004 19:22:23 -0000 1.2
+++ binary.h 5 Nov 2004 08:46:02 -0000 1.3
@@ -1,7 +1,7 @@
/* binary.h
* Copyright: 2004 The Perl Foundation. All Rights Reserved.
* CVS Info
- * $Id: binary.h,v 1.2 2004/11/03 19:22:23 dan Exp $
+ * $Id: binary.h,v 1.3 2004/11/05 08:46:02 leo Exp $
* Overview:
* This is the header for the binary charset functions
* Data Structure and Algorithms:
@@ -27,8 +27,8 @@
static void downcase_first(Interp *interpreter, STRING *source_string);
static void titlecase_first(Interp *interpreter, STRING *source_string);
static INTVAL compare(Interp *interpreter, STRING *lhs, STRING *rhs);
-static INTVAL index(Interp *interpreter, STRING *source_string, STRING
*search_string, UINTVAL offset);
-static INTVAL rindex(Interp *interpreter, STRING *source_string, STRING
*search_string, UINTVAL offset);
+static INTVAL cs_index(Interp *interpreter, STRING *source_string, STRING
*search_string, UINTVAL offset);
+static INTVAL cs_rindex(Interp *interpreter, STRING *source_string, STRING
*search_string, UINTVAL offset);
static UINTVAL validate(Interp *interpreter, STRING *source_string);
static INTVAL is_wordchar(Interp *interpreter, STRING *source_string, UINTVAL
offset);
static INTVAL find_wordchar(Interp *interpreter, STRING *source_string, UINTVAL
offset);
1.2 +7 -7 parrot/charset/iso-8859-1.c
Index: iso-8859-1.c
===================================================================
RCS file: /cvs/public/parrot/charset/iso-8859-1.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- iso-8859-1.c 3 Nov 2004 23:43:05 -0000 1.1
+++ iso-8859-1.c 5 Nov 2004 08:46:02 -0000 1.2
@@ -1,6 +1,6 @@
/*
Copyright: 2004 The Perl Foundation. All Rights Reserved.
-$Id: iso-8859-1.c,v 1.1 2004/11/03 23:43:05 dan Exp $
+$Id: iso-8859-1.c,v 1.2 2004/11/05 08:46:02 leo Exp $
=head1 NAME
@@ -127,11 +127,11 @@
return 0;
}
-static INTVAL index(Interp *interpreter, STRING *source_string, STRING
*search_string, UINTVAL offset) {
+static INTVAL cs_index(Interp *interpreter, STRING *source_string, STRING
*search_string, UINTVAL offset) {
return -1;
}
-static INTVAL rindex(Interp *interpreter, STRING *source_string, STRING
*search_string, UINTVAL offset) {
+static INTVAL cs_rindex(Interp *interpreter, STRING *source_string, STRING
*search_string, UINTVAL offset) {
return -1;
}
@@ -223,8 +223,8 @@
downcase_first,
titlecase_first,
compare,
- index,
- rindex,
+ cs_index,
+ cs_rindex,
validate,
is_wordchar,
find_wordchar,
@@ -245,10 +245,10 @@
};
preferred_encoding = Parrot_load_encoding(interpreter, "fixed_8");
-
+
memcpy(return_set, &base_set, sizeof(CHARSET));
return return_set;
-
+
}
/*
1.2 +3 -3 parrot/charset/iso-8859-1.h
Index: iso-8859-1.h
===================================================================
RCS file: /cvs/public/parrot/charset/iso-8859-1.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- iso-8859-1.h 3 Nov 2004 23:43:05 -0000 1.1
+++ iso-8859-1.h 5 Nov 2004 08:46:02 -0000 1.2
@@ -1,7 +1,7 @@
/* iso_8859_1.h
* Copyright: 2004 The Perl Foundation. All Rights Reserved.
* CVS Info
- * $Id: iso-8859-1.h,v 1.1 2004/11/03 23:43:05 dan Exp $
+ * $Id: iso-8859-1.h,v 1.2 2004/11/05 08:46:02 leo Exp $
* Overview:
* This is the header for the iso_8859-1 charset functions
* Data Structure and Algorithms:
@@ -27,8 +27,8 @@
static void downcase_first(Interp *interpreter, STRING *source_string);
static void titlecase_first(Interp *interpreter, STRING *source_string);
static INTVAL compare(Interp *interpreter, STRING *lhs, STRING *rhs);
-static INTVAL index(Interp *interpreter, STRING *source_string, STRING
*search_string, UINTVAL offset);
-static INTVAL rindex(Interp *interpreter, STRING *source_string, STRING
*search_string, UINTVAL offset);
+static INTVAL cs_index(Interp *interpreter, STRING *source_string, STRING
*search_string, UINTVAL offset);
+static INTVAL cs_rindex(Interp *interpreter, STRING *source_string, STRING
*search_string, UINTVAL offset);
static UINTVAL validate(Interp *interpreter, STRING *source_string);
static INTVAL is_wordchar(Interp *interpreter, STRING *source_string, UINTVAL
offset);
static INTVAL find_wordchar(Interp *interpreter, STRING *source_string, UINTVAL
offset);
1.5 +4 -4 parrot/encodings/fixed_8.c
Index: fixed_8.c
===================================================================
RCS file: /cvs/public/parrot/encodings/fixed_8.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- fixed_8.c 4 Nov 2004 18:01:28 -0000 1.4
+++ fixed_8.c 5 Nov 2004 08:46:03 -0000 1.5
@@ -1,6 +1,6 @@
/*
Copyright: 2004 The Perl Foundation. All Rights Reserved.
-$Id: fixed_8.c,v 1.4 2004/11/04 18:01:28 dan Exp $
+$Id: fixed_8.c,v 1.5 2004/11/05 08:46:03 leo Exp $
=head1 NAME
@@ -39,10 +39,10 @@
}
static UINTVAL get_byte(Interp *interpreter, STRING *source_string, UINTVAL offset)
{
+ char *contents = source_string->strstart;
if (offset >= source_string->bufused) {
internal_exception(0, "get_byte past the end of the buffer");
}
- char *contents = source_string->strstart;
return contents[offset];
}
@@ -51,13 +51,13 @@
/* Delegate to get_bytes */
static STRING *get_codepoints(Interp *interpreter, STRING *source_string, UINTVAL
offset, UINTVAL count) {
-
+
return get_bytes(interpreter, source_string, offset, count);
}
static STRING *get_bytes(Interp *interpreter, STRING *source_string, UINTVAL
offset, UINTVAL count) {
STRING *return_string = NULL;
-
+
return return_string;
}