As a data point, here are the changes I had to make to get C++
compilability.
(Using incompatible pointers in the source code is not acceptable; if
introduced, I will eventually fix them when I C++-ize the source code.)
This is NOT a recommended patch. This is merely to suggest to Oliver
what kinds of changes I had to make. They must be resolved
eventually. Oliver, you may choose to keep the casts I made, but
think about whether making casts at all casts doubt on some of the
code, esp. regarding mule-ized-ness.
Happy hurling!
--- src/event-Xt.c.old
+++ src/event-Xt.c
@@ -1166,7 +1166,7 @@
{
len = strlen ((char*)data);
hurl = dnd_url_hexify_string ((char *)data, "file:");
- l_item = make_string (hurl, strlen (hurl));
+ l_item = make_string ((Bufbyte *) hurl, strlen (hurl));
l_dndlist = Fcons (l_item, l_dndlist);
data += len + 1;
xfree (hurl);
@@ -1176,8 +1176,8 @@
break;
case DndText:
l_type = Qdragdrop_MIME;
- l_dndlist = list1 ( list3 ( make_string ("text/plain", 10),
- make_string ("8bit", 4),
+ l_dndlist = list1 ( list3 ( make_string ((Bufbyte *) "text/plain", 10),
+ make_string ((Bufbyte *) "8bit", 4),
make_ext_string (data,
strlen((char *)data),
FORMAT_CTEXT) ) );
@@ -1199,9 +1199,9 @@
case DndLink:
case DndExe:
{
- char *hurl = dnd_url_hexify_string (data, "file:");
+ char *hurl = dnd_url_hexify_string ((char *) data, "file:");
- l_dndlist = list1 ( make_string (hurl, strlen (hurl)) );
+ l_dndlist = list1 (make_string ((Bufbyte *) hurl, strlen (hurl)) );
l_type = Qdragdrop_URL;
xfree (hurl);
@@ -1210,15 +1210,15 @@
case DndURL:
/* as it is a real URL it should already be escaped
and escaping again will break them (cause % is unsave) */
- l_dndlist = list1 ( make_ext_string ((char *)data,
+ l_dndlist = list1 ( make_ext_string ((Extbyte *)data,
strlen ((char *)data),
FORMAT_FILENAME) );
l_type = Qdragdrop_URL;
break;
default: /* Unknown, RawData and any other type */
- l_dndlist = list1 ( list3 ( make_string ("application/octet-stream", 24),
- make_string ("8bit", 4),
- make_ext_string ((char *)data, size,
+ l_dndlist = list1 ( list3 ( make_string ((Bufbyte *) "application/octet-stream", 24),
+ make_string ((Bufbyte *) "8bit", 4),
+ make_ext_string ((Extbyte *)data, size,
FORMAT_BINARY) ) );
l_type = Qdragdrop_MIME;
break;
--- src/frame-x.c.old
+++ src/frame-x.c
@@ -1125,7 +1125,7 @@
filePath = transferInfo->dropData->data.files[ii];
hurl = dnd_url_hexify_string ((char *)filePath, "file:");
/* ### Mule-izing required */
- l_data = Fcons ( make_string (hurl, strlen (hurl)), l_data );
+ l_data = Fcons (make_string ((Bufbyte *) hurl, strlen (hurl)), l_data );
xfree (hurl);
}
}
@@ -1144,9 +1144,9 @@
path = (filePath == NULL) ? Qnil
: make_string ((Bufbyte *)filePath, strlen (filePath)); */
/* what, if the data is no text, and how can I tell it? */
- l_data = Fcons ( list3 ( make_string ("text/plain", 10),
- make_string ("8bit", 4),
- make_ext_string (transferInfo->dropData->data.buffers[ii].bp,
+ l_data = Fcons ( list3 ( make_string ((Bufbyte *) "text/plain", 10),
+ make_string ((Bufbyte *) "8bit", 4),
+ make_ext_string ((Extbyte *) transferInfo->dropData->data.buffers[ii].bp,
transferInfo->dropData->data.buffers[ii].size,
FORMAT_CTEXT) ),
l_data );