Skip to content

Commit

Permalink
- remove annoying 'rtcXXX' from warn/croak messages
Browse files Browse the repository at this point in the history
  • Loading branch information
dk committed Feb 18, 2014
1 parent 644ae48 commit 86a6614
Show file tree
Hide file tree
Showing 16 changed files with 96 additions and 96 deletions.
30 changes: 15 additions & 15 deletions AbstractMenu.c
Expand Up @@ -146,15 +146,15 @@ AbstractMenu_new_menu( Handle self, SV * sv, int level)
}

if ( !SvROK( sv) || ( SvTYPE( SvRV( sv)) != SVt_PVAV)) {
warn("RTC0034: menu build error: menu is not an array");
warn("menu build error: menu is not an array");
return nil;
}
av = (AV *) SvRV( sv);
n = av_len( av);

if ( n == -1) {
if ( level == 0) return nil; /* null menu */
warn("RTC003E: menu build error: empty array passed");
warn("menu build error: empty array passed");
return nil;
}
/* log_write("%s(%d){", buf, n+1); */
Expand All @@ -177,20 +177,20 @@ AbstractMenu_new_menu( Handle self, SV * sv, int level)

if ( itemHolder == nil)
{
warn("RTC0035: menu build error: array panic");
warn("menu build error: array panic");
my-> dispose_menu( self, m);
return nil;
}
if ( !SvROK( *itemHolder) || ( SvTYPE( SvRV( *itemHolder)) != SVt_PVAV)) {
warn("RTC0036: menu build error: submenu is not an array");
warn("menu build error: submenu is not an array");
my-> dispose_menu( self, m);
return nil;
}
/* entering item description */
item = ( AV *) SvRV( *itemHolder);
count = av_len( item) + 1;
if ( count > 6) {
warn("RTC0032: menu build error: extra declaration");
warn("menu build error: extra declaration");
count = 5;
}
if ( !( r = alloc1z( MenuItemReg))) {
Expand Down Expand Up @@ -245,7 +245,7 @@ AbstractMenu_new_menu( Handle self, SV * sv, int level)
fl_ = prima_is_utf8_sv(*holder); \
} \
} else { \
warn("RTC003A: menu build error: array panic"); \
warn("menu build error: array panic"); \
my-> dispose_menu( self, m); \
return nil; \
} \
Expand All @@ -255,7 +255,7 @@ AbstractMenu_new_menu( Handle self, SV * sv, int level)
if ( l_key >= 0) {
holder = av_fetch( item, l_key, 0);
if ( !holder) {
warn("RTC003B: menu build error: array panic");
warn("menu build error: array panic");
my-> dispose_menu( self, m);
return nil;
}
Expand Down Expand Up @@ -300,7 +300,7 @@ AbstractMenu_new_menu( Handle self, SV * sv, int level)
{
holder = av_fetch( item, l_text, 0);
if ( !holder) {
warn("RTC003C: menu build error: array panic");
warn("menu build error: array panic");
my-> dispose_menu( self, m);
return nil;
}
Expand All @@ -310,14 +310,14 @@ AbstractMenu_new_menu( Handle self, SV * sv, int level)
Handle c_object = gimme_the_mate( subItem);
if (( c_object == nilHandle) || !( kind_of( c_object, CImage)))
{
warn("RTC0033: menu build error: not an image passed");
warn("menu build error: not an image passed");
goto TEXT;
}
/* log_write("%sbmp: %s %d", buf, ((PComponent)c_object)->name, kind_of( c_object, CImage)); */
if (((( PImage) c_object)-> w == 0)
|| ((( PImage) c_object)-> h == 0))
{
warn("RTC0037: menu build error: invalid image passed");
warn("menu build error: invalid image passed");
goto TEXT;
}
protect_object( r-> bitmap = c_object);
Expand All @@ -334,7 +334,7 @@ AbstractMenu_new_menu( Handle self, SV * sv, int level)
{
holder = av_fetch( item, l_sub, 0);
if ( !holder) {
warn("RTC003D: menu build error: array panic");
warn("menu build error: array panic");
my-> dispose_menu( self, m);
return nil;
}
Expand All @@ -359,7 +359,7 @@ AbstractMenu_new_menu( Handle self, SV * sv, int level)
r-> perlSub = duplicate_string( SvPV_nolen( subItem));
r-> flags. utf8_perlSub = prima_is_utf8_sv( subItem);
} else {
warn("RTC0038: menu build error: invalid sub name passed");
warn("menu build error: invalid sub name passed");
}
}
}
Expand All @@ -369,7 +369,7 @@ AbstractMenu_new_menu( Handle self, SV * sv, int level)
{
holder = av_fetch( item, l_data, 0);
if ( !holder) {
warn("RTC003D: menu build error: array panic");
warn("menu build error: array panic");
my-> dispose_menu( self, m);
return nil;
}
Expand Down Expand Up @@ -778,11 +778,11 @@ AbstractMenu_image( Handle self, Bool set, char * varName, Handle image)
}

if (( image == nilHandle) || !( kind_of( image, CImage))) {
warn("RTC0039: invalid object passed to ::image");
warn("invalid object passed to ::image");
return nilHandle;
}
if ( i-> w == 0 || i-> h == 0) {
warn("RTC0039: invalid object passed to ::image");
warn("invalid object passed to ::image");
return nilHandle;
}

Expand Down
10 changes: 5 additions & 5 deletions Application.c
Expand Up @@ -55,14 +55,14 @@ Application_init( Handle self, HV * profile)
SV * sv;
char * hintClass = pget_c( hintClass);
if ( application != nilHandle)
croak( "RTC0010: Attempt to create more than one application instance");
croak( "Attempt to create more than one application instance");

CDrawable-> init( self, profile);
list_create( &var-> widgets, 16, 16);
list_create( &var-> modalHorizons, 0, 8);
application = self;
if ( !apc_application_create( self))
croak( "RTC0011: Error creating application");
croak( "Error creating application");
/* Widget init */
SvHV_Font( pget_sv( font), &Font_buffer, "Application::init");
my-> set_font( self, Font_buffer);
Expand All @@ -74,12 +74,12 @@ Application_init( Handle self, HV * profile)
if ( holder)
var-> designScale. x = SvNV( *holder);
else
warn("RTC0012: Array panic on 'designScale'");
warn("Array panic on 'designScale'");
holder = av_fetch( av, 1, 0);
if ( holder)
var-> designScale. y = SvNV( *holder);
else
warn("RTC0012: Array panic on 'designScale'");
warn("Array panic on 'designScale'");
pdelete( designScale);
}
var-> text = duplicate_string("");
Expand Down Expand Up @@ -525,7 +525,7 @@ Application_icon( Handle self, Bool set, Handle icon)
return var-> icon;

if ( icon && !kind_of( icon, CImage)) {
warn("RTC0013: Illegal object reference passed to Application::icon");
warn("Illegal object reference passed to Application::icon");
return nilHandle;
}
if ( icon) {
Expand Down
4 changes: 2 additions & 2 deletions Clipboard.c
Expand Up @@ -78,7 +78,7 @@ Clipboard_init( Handle self, HV * profile)
{
inherited init( self, profile);
if ( !apc_clipboard_create(self))
croak( "RTC0022: Cannot create clipboard");
croak( "Cannot create clipboard");
if (clipboards == 0) {
Clipboard_register_format_proc( self, "Text", (void*)text_server);
Clipboard_register_format_proc( self, "Image", (void*)image_server);
Expand Down Expand Up @@ -464,7 +464,7 @@ image_server( Handle self, PClipboardFormatReg instance, int function, SV * data
c. image = gimme_the_mate( data);

if ( !kind_of( c. image, CImage)) {
warn("RTC0023: Not an image passed to clipboard");
warn("Not an image passed to clipboard");
return nilSV;
}
instance-> written = apc_clipboard_set_data( self, cfBitmap, &c);
Expand Down
18 changes: 9 additions & 9 deletions Component.c
Expand Up @@ -218,13 +218,13 @@ Component_attach( Handle self, Handle object)
var-> components = plist_create( 8, 8);
else
if ( list_index_of( var-> components, object) >= 0) {
warn( "RTC0040: Object attach failed");
warn( "Object attach failed");
return;
}
list_add( var-> components, object);
SvREFCNT_inc( SvRV(( PObject( object))-> mate));
} else
warn( "RTC0040: Object attach failed");
warn( "Object attach failed");
}

void
Expand Down Expand Up @@ -337,7 +337,7 @@ Component_message( Handle self, PEvent event)
unprotect_object( self);
} else if ( var-> stage == csConstructing) {
if ( var-> evQueue == nil)
croak("RTC0041: Object set twice to constructing stage");
croak("Object set twice to constructing stage");
Constructing:
switch ( event-> cmd & ctQueueMask) {
case ctDiscardable:
Expand Down Expand Up @@ -397,7 +397,7 @@ Component_pop_event( Handle self)
if ( var-> stage == csDead)
return false;
if ( !var-> evStack || var-> evPtr <= 0) {
warn("RTC0042: Component::pop_event call not within message()");
warn("Component::pop_event call not within message()");
return false;
}
return var-> evStack[ --var-> evPtr];
Expand All @@ -410,7 +410,7 @@ Component_eventFlag( Handle self, Bool set, Bool eventFlag)
if ( var-> stage == csDead)
return false;
if ( !var-> evStack || var-> evPtr <= 0) {
warn("RTC0043: Component::eventFlag call not within message()");
warn("Component::eventFlag call not within message()");
return false;
}
if ( set)
Expand Down Expand Up @@ -639,7 +639,7 @@ XS( Component_event_hook_FROMPERL)
}

if ( !SvROK( hook) || ( SvTYPE( SvRV( hook)) != SVt_PVCV)) {
warn("RTC04D: Not a CODE reference passed to Prima::Component::event_hook");
warn("Not a CODE reference passed to Prima::Component::event_hook");
PUTBACK;
return;
}
Expand Down Expand Up @@ -719,7 +719,7 @@ XS( Component_notify_FROMPERL)
if ( hv_exists( hv, name, nameLen)) {
SV ** holder = hv_fetch( hv, name, nameLen, 0);
if ( !holder || !SvOK(*holder) || SvTYPE(*holder) == SVt_NULL)
croak("RTC0045: Inconsistent storage in %s::notification_types for %s during Component.notify", var-> self-> className, name);
croak("Inconsistent storage in %s::notification_types for %s during Component.notify", var-> self-> className, name);
rnt = SvIV( *holder);
} else {
warn("Unknown notification:%s", name);
Expand Down Expand Up @@ -912,13 +912,13 @@ Component_add_notification( Handle self, char * name, SV * subroutine, Handle re
res = my-> notification_types( self);
if ( !hv_exists(( HV *) SvRV( res), name, nameLen)) {
sv_free( res);
warn("RTC04B: No such event %s", name);
warn("No such event %s", name);
return 0;
}
sv_free( res);

if ( !subroutine || !SvROK( subroutine) || ( SvTYPE( SvRV( subroutine)) != SVt_PVCV)) {
warn("RTC04C: Not a CODE reference passed to %s to Component::add_notification", name);
warn("Not a CODE reference passed to %s to Component::add_notification", name);
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion DeviceBitmap.c
Expand Up @@ -49,7 +49,7 @@ DeviceBitmap_init( Handle self, HV * profile)
var-> h = pget_i( height);
var-> monochrome = pget_B( monochrome);
if ( !apc_dbm_create( self, var-> monochrome))
croak("RTC0110: Cannot create device bitmap");
croak("Cannot create device bitmap");
inherited begin_paint( self);
opt_set( optInDraw);
CORE_INIT_TRANSIENT(DeviceBitmap);
Expand Down
22 changes: 11 additions & 11 deletions Drawable.c
Expand Up @@ -82,9 +82,9 @@ Drawable_init( Handle self, HV * profile)
AV * av = ( AV *) SvRV( pget_sv( translate));
Point tr = {0,0};
SV ** holder = av_fetch( av, 0, 0);
if ( holder) tr.x = SvIV( *holder); else warn("RTC0059: Array panic on 'translate'");
if ( holder) tr.x = SvIV( *holder); else warn("Array panic on 'translate'");
holder = av_fetch( av, 1, 0);
if ( holder) tr.y = SvIV( *holder); else warn("RTC0059: Array panic on 'translate'");
if ( holder) tr.y = SvIV( *holder); else warn("Array panic on 'translate'");
my-> set_translate( self, tr);
}
SvHV_Font( pget_sv( font), &Font_buffer, "Drawable::init");
Expand Down Expand Up @@ -180,9 +180,9 @@ Drawable_set( Handle self, HV * profile)
AV * av = ( AV *) SvRV( pget_sv( translate));
Point tr = {0,0};
SV ** holder = av_fetch( av, 0, 0);
if ( holder) tr.x = SvIV( *holder); else warn("RTC0059: Array panic on 'translate'");
if ( holder) tr.x = SvIV( *holder); else warn("Array panic on 'translate'");
holder = av_fetch( av, 1, 0);
if ( holder) tr.y = SvIV( *holder); else warn("RTC0059: Array panic on 'translate'");
if ( holder) tr.y = SvIV( *holder); else warn("Array panic on 'translate'");
my-> set_translate( self, tr);
pdelete( translate);
}
Expand Down Expand Up @@ -472,13 +472,13 @@ Drawable_polypoints( SV * points, char * procName, int mod, int * n_points)
Point * p;

if ( !SvROK( points) || ( SvTYPE( SvRV( points)) != SVt_PVAV)) {
warn("RTC0050: Invalid array reference passed to %s", procName);
warn("Invalid array reference passed to %s", procName);
return nil;
}
av = ( AV *) SvRV( points);
count = av_len( av) + 1;
if ( count % mod) {
warn("RTC0051: Drawable::%s: Number of elements in an array must be a multiple of %d",
warn("Drawable::%s: Number of elements in an array must be a multiple of %d",
procName, mod);
return nil;
}
Expand All @@ -491,7 +491,7 @@ Drawable_polypoints( SV * points, char * procName, int mod, int * n_points)
SV** psvy = av_fetch( av, i * 2 + 1, 0);
if (( psvx == nil) || ( psvy == nil)) {
free( p);
warn("RTC0052: Array panic on item pair %d on Drawable::%s", i, procName);
warn("Array panic on item pair %d on Drawable::%s", i, procName);
return nil;
}
p[ i]. x = SvIV( *psvx);
Expand Down Expand Up @@ -1412,7 +1412,7 @@ Drawable_region( Handle self, Bool set, Handle mask)

if ( set) {
if ( mask && !kind_of( mask, CImage)) {
warn("RTC005A: Illegal object reference passed to Drawable::region");
warn("Illegal object reference passed to Drawable::region");
return nilHandle;
}

Expand Down Expand Up @@ -1504,13 +1504,13 @@ Drawable_fillPattern( Handle self, Bool set, SV * svpattern)
FillPattern fp;
AV * av = ( AV *) SvRV( svpattern);
if ( av_len( av) != 7) {
warn("RTC0056: Illegal fillPattern passed to Drawable::fillPattern");
warn("Illegal fillPattern passed to Drawable::fillPattern");
return nilSV;
}
for ( i = 0; i < 8; i++) {
SV ** holder = av_fetch( av, i, 0);
if ( !holder) {
warn("RTC0057: Array panic on Drawable::fillPattern");
warn("Array panic on Drawable::fillPattern");
return nilSV;
}
fp[ i] = SvIV( *holder);
Expand All @@ -1519,7 +1519,7 @@ Drawable_fillPattern( Handle self, Bool set, SV * svpattern)
} else {
int id = SvIV( svpattern);
if (( id < 0) || ( id > fpMaxId)) {
warn("RTC0058: fillPattern index out of range passed to Drawable::fillPattern");
warn("fillPattern index out of range passed to Drawable::fillPattern");
return nilSV;
}
apc_gp_set_fill_pattern( self, fillPatterns[ id]);
Expand Down
10 changes: 5 additions & 5 deletions Image.c
Expand Up @@ -107,7 +107,7 @@ Image_init( Handle self, HV * profile)

{
Point set;
prima_read_point( pget_sv( resolution), (int*)&set, 2, "RTC0109: Array panic on 'resolution'");
prima_read_point( pget_sv( resolution), (int*)&set, 2, "Array panic on 'resolution'");
my-> set_resolution( self, set);
}
if ( var->type & imGrayScale) switch ( var->type & imBPP)
Expand Down Expand Up @@ -284,7 +284,7 @@ Image_set( Handle self, HV * profile)
{
int newType = pget_i( type);
if ( !itype_supported( newType))
warn("RTC0100: Invalid image type requested (%08x) in Image::set_type", newType);
warn("Invalid image type requested (%08x) in Image::set_type", newType);
else
if ( !opt_InPaint) {
SV * palette;
Expand All @@ -309,7 +309,7 @@ Image_set( Handle self, HV * profile)
if ( pexist( resolution))
{
Point set;
prima_read_point( pget_sv( resolution), (int*)&set, 2, "RTC0109: Array panic on 'resolution'");
prima_read_point( pget_sv( resolution), (int*)&set, 2, "Array panic on 'resolution'");
my-> set_resolution( self, set);
pdelete( resolution);
}
Expand Down Expand Up @@ -964,7 +964,7 @@ Image_palette( Handle self, Bool set, SV * palette)
if ( ps)
var-> palSize = ps;
else
warn("RTC0107: Invalid array reference passed to Image::palette");
warn("Invalid array reference passed to Image::palette");
my-> update_change( self);
} else {
int i;
Expand Down Expand Up @@ -1261,7 +1261,7 @@ Image_dup( Handle self)
memcpy( i-> palette, var->palette, 768);
i-> palSize = var-> palSize;
if ( i-> type != var->type)
croak("RTC0108: Image::dup consistency failed");
croak("Image::dup consistency failed");
else
memcpy( i-> data, var->data, var->dataSize);
memcpy( i-> stats, var->stats, sizeof( var->stats));
Expand Down

0 comments on commit 86a6614

Please sign in to comment.