[haiku-gsoc] Re: [patch]Locale Kit catalog add-ons loading

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-gsoc@xxxxxxxxxxxxx
  • Date: Fri, 05 Jun 2009 21:18:39 +0200 CEST

PulkoMandy <pulkomandy@xxxxxxxxx> wrote:
> Hello,
> Here is a small fix for the locale kit, allowing proper load of
> catalog add-ons. I encountered this problem while working on the
> plaintext add-on, which is not finished yet, but can at least be
> loaded for testing.

There are a few issues I like to point out:

> +++ src/add-ons/locale/catalogs/zeta/Catalog.cpp      (copie de travail)
> @@ -85,5 +85,5 @@
>       return catalog;
>  }
>  
> -uint8 gCatalogAddOnPriority = 5;
> +extern uint8 gCatalogAddOnPriority = 5;
>       // priority for Zeta catalog-add-on

Why extern? Where is it defined?
Also, you usually cannot assign a value for "extern" variables in a 
static way.

>                                                                       
> &priority, sizeof(int8));
>                                                       }
> +                                                     else
> +                                                             
> log_team(LOG_ERR, 
> +                                                                     
> "couldn't get priority for add-on 
> %s\n", 
> +                                                                     
> fullAddOnPath.String());
>                                                       unload_add_on(image);

Coding style violations: the "else" goes to the same line as the '}', 
and multi-line terms are *always* enclosed in brackets, ie. this should 
look like this:

                                                        } else {
                                                                
log_team(LOG_ERR, 
                                                                        
"couldn't get priority for add-on 
%s\n", 
                                                                        
fullAddOnPath.String());
                                                        }
                                                        unload_add_on(image);

Bye,
   Axel.


Other related posts: