diff --git a/ChangeLog b/ChangeLog index e110126c..d168095c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ - oops, moreconst and moreeqconst were the same - better buffer handling in sinkdisc for single-line images - less chatty errors from "vips" +- oops, don't rename "copy_set" as "copy_", thanks Ole 12/5/10 started 7.22.0 - bump and rename diff --git a/TODO b/TODO index 97f8b9dc..b751132d 100644 --- a/TODO +++ b/TODO @@ -1,7 +1,4 @@ -- drop "set" suffix renames im_copy_set as copy_ argh - - I guess this causes nip2 problems as well? or we call the full name I guess - +- regenerate c++ and python bindings, 7.22 branch needs copy_set fix - lcms2 needs testing diff --git a/tools/iofuncs/vips.c b/tools/iofuncs/vips.c index 2d484850..5dd7bd86 100644 --- a/tools/iofuncs/vips.c +++ b/tools/iofuncs/vips.c @@ -34,6 +34,7 @@ * - drop _f postfixes, drop many postfixes * 24/6/10 * - less chatty error messages + * - oops, don't rename "copy_set" as "copy_" */ /* @@ -463,7 +464,10 @@ drop_postfix( char *str, const char *postfix ) static void c2cpp_name( const char *in, char *out ) { - static const char *postfix[] = { + static const char *dont_drop[] = { + "_set", + }; + static const char *drop[] = { "_vec", "const", "tra", @@ -481,12 +485,24 @@ c2cpp_name( const char *in, char *out ) else strcpy( out, in ); - /* Repeatedly drop postfixes while we can. + /* Repeatedly drop postfixes while we can. Stop if we see a dont_drop + * postfix. */ do { + gboolean found; + + found = FALSE; + for( i = 0; i < IM_NUMBER( dont_drop ); i++ ) + if( ispostfix( dont_drop[i], out ) ) { + found = TRUE; + break; + } + if( found ) + break; + changed = FALSE; - for( i = 0; i < IM_NUMBER( postfix ); i++ ) - changed |= drop_postfix( out, postfix[i] ); + for( i = 0; i < IM_NUMBER( drop ); i++ ) + changed |= drop_postfix( out, drop[i] ); } while( changed ); }