summaryrefslogtreecommitdiff
path: root/x2p
diff options
context:
space:
mode:
authorCraig A. Berry <craigberry@mac.com>2012-07-15 16:18:42 -0500
committerCraig A. Berry <craigberry@mac.com>2012-07-31 18:42:41 -0500
commitcfb8f080895a44c06733a04064300a07f255aeb0 (patch)
tree1b946c51a40c5f99942ced4b5157cce4c4988c00 /x2p
parent40b6423cb7af5e5b76038bef524e04a65967825a (diff)
downloadperl-cfb8f080895a44c06733a04064300a07f255aeb0.tar.gz
x2p/str.c C++ clean-up.
Compiling str.c with HP C++ for OpenVMS says, FILE_ptr(fp) = (void*)ptr; /* LHS STDCHAR* cast non-portable */ .....................^ %CXX-E-INCASSOPN, a value of type "void *" cannot be assigned to an entity of type "char *" at line number 213 in file D0:[craig.blead.x2p]str.c;1 FILE_ptr(fp) = (void*)ptr; /* LHS STDCHAR* cast non-portable */ .................^ %CXX-E-INCASSOPN, a value of type "void *" cannot be assigned to an entity of type "char *" at line number 233 in file D0:[craig.blead.x2p]str.c;1 So remove the void casts to avoid the errors. This is an exact mirror of d06fc7d4ca98, which also removed the void cast from an equivalent line in perlio.c. That was almost six years ago, so if anything especially dire were going to happen without the cast, it likely would have happened by now. The casts were added by cc00df79d5 and 5faea5d5, the former of which refers vaguely to "compiler worries" without specifying what they were, but signedness warnings are a likely suspect. We'll get those again now, but warnings are less bad than errors. A more robust solution would be to add a Configure-time detection of the type of FILE._ptr and cast everything to that. An even more robust solution would be to eliminate all the "buffer snooping" mechanisms and concede that maintaining an stdio implementation is a job for stdio maintainers and not Perl maintainers.
Diffstat (limited to 'x2p')
-rw-r--r--x2p/str.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/x2p/str.c b/x2p/str.c
index 58798c011f..d54d08818b 100644
--- a/x2p/str.c
+++ b/x2p/str.c
@@ -210,7 +210,7 @@ str_gets(register STR *str, register FILE *fp)
}
FILE_cnt(fp) = cnt; /* deregisterize cnt and ptr */
- FILE_ptr(fp) = (void*)ptr; /* LHS STDCHAR* cast non-portable */
+ FILE_ptr(fp) = ptr;
i = getc(fp); /* get more characters */
cnt = FILE_cnt(fp);
ptr = (STDCHAR*)FILE_ptr(fp); /* reregisterize cnt and ptr */
@@ -230,7 +230,7 @@ str_gets(register STR *str, register FILE *fp)
thats_all_folks:
FILE_cnt(fp) = cnt; /* put these back or we're in trouble */
- FILE_ptr(fp) = (void*)ptr; /* LHS STDCHAR* cast non-portable */
+ FILE_ptr(fp) = ptr;
*bp = '\0';
str->str_cur = bp - str->str_ptr; /* set length */