From c8bebd24156037b7121237a874bf37edcb3e6d2e Mon Sep 17 00:00:00 2001 From: rdale Date: Fri, 12 Dec 2008 16:36:48 +0000 Subject: [PATCH] * Revert the recent change for marshalling 'unsigned char*' types which expected them to be null terminated. After more thought it is pretty likely they won't be null terminated because if they were they would have been defined as just 'char *' instead. It better to have a clear message saying they aren't supported and need special casing, rather than needing to track down possible random buggy effects. CCMAIL: kde-bindings@kde.org git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/KDE/kdebindings@896140 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- ruby/qtruby/ChangeLog | 6 ++++++ ruby/qtruby/src/marshall_basetypes.h | 12 +----------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/ruby/qtruby/ChangeLog b/ruby/qtruby/ChangeLog index ed626165..f5769698 100644 --- a/ruby/qtruby/ChangeLog +++ b/ruby/qtruby/ChangeLog @@ -3,6 +3,12 @@ types prefer the non-const version of the arg. Thanks to Davor Ocelic for explaining why this was a good idea in the case of the Qt::Image constructors. + * Revert the recent change for marshalling 'unsigned char*' types which + expected them to be null terminated. After more thought it is pretty + likely they won't be null terminated because if they were they would + have been defined as just 'char *' instead. It better to have a clear + message saying they aren't supported and need special casing, rather + than needing to track down possible random buggy effects. 2008-12-11 Richard Dale * Make some changes from the patch at diff --git a/ruby/qtruby/src/marshall_basetypes.h b/ruby/qtruby/src/marshall_basetypes.h index bc6758b8..030e8cc7 100644 --- a/ruby/qtruby/src/marshall_basetypes.h +++ b/ruby/qtruby/src/marshall_basetypes.h @@ -200,17 +200,7 @@ void marshall_to_ruby(Marshall *m) template <> void marshall_to_ruby(Marshall *m) { - char * sv = (char *)m->item().s_voidp; - VALUE obj; - if (sv != 0) - obj = rb_str_new2(sv); - else - obj = Qnil; - - if (m->cleanup()) - delete[] sv; - - *(m->var()) = obj; + m->unsupported(); } #endif -- 2.11.4.GIT