Show
Ignore:
Timestamp:
12/29/09 09:07:41 (2 years ago)
Author:
erikd
Message:

Remove needless #defines of buffer lengths.

Code had many instances of:

#undef BUF_LEN
#define BUF_LEN 64
char buf[BUF_LEN];
snprintf (buf, BUF_LEN, ....);

which can be replaced with:

char buf[64];
snprintf (buf, sizeof (buf), ....);

which is far cleaner and more difficult to get wrong.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sweep/trunk/plugins/ladspa/ladspameta.c

    r688 r691  
    653653ladspa_meta_add_procs (gchar * dir, gchar * name) 
    654654{ 
    655 #define PATH_LEN 256 
    656   gchar path[PATH_LEN]; 
     655  gchar path[256]; 
    657656  void * module; 
    658657  LADSPA_Descriptor_Function desc_func; 
     
    663662  sw_procedure * proc; 
    664663 
    665   snprintf (path, PATH_LEN, "%s/%s", dir, name); 
     664  snprintf (path, sizeof (path), "%s/%s", dir, name); 
    666665 
    667666  module = dlopen (path, RTLD_NOW);