Changeset 5227:beb26bba0901 in roaraudio for libroar/vio_dstr.c


Ignore:
Timestamp:
11/12/11 13:26:38 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added const keywords to roar_vio_open_dstr(), roar_vio_open_dstr_vio(), roar_vs_file_simple() and roar_vs_new_from_file()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/vio_dstr.c

    r4984 r5227  
    360360#endif 
    361361 
    362 int     roar_vio_open_dstr    (struct roar_vio_calls * calls, char * dstr, struct roar_vio_defaults * def, int dnum) { 
     362int     roar_vio_open_dstr    (struct roar_vio_calls * calls, const char * dstr, struct roar_vio_defaults * def, int dnum) { 
    363363 return roar_vio_open_dstr_vio(calls, dstr, def, dnum, NULL); 
    364364} 
    365365 
    366 #define _ret(x) do { int _err = roar_error; roar_mm_free(dstr); roar_error = _err; roar_err_to_errno(); return (x); } while (0) 
     366#define _ret(x) do { int _err = roar_error; roar_mm_free(dstr_copy); roar_error = _err; roar_err_to_errno(); return (x); } while (0) 
    367367 
    368368int     roar_vio_open_dstr_vio(struct roar_vio_calls * calls, 
    369                                char * dstr, struct roar_vio_defaults * def, int dnum, 
     369                               const char * dstr, struct roar_vio_defaults * def, int dnum, 
    370370                               struct roar_vio_calls * vio) { 
    371371#ifndef ROAR_WITHOUT_VIO_DSTR 
    372372 struct roar_vio_dstr_chain chain[ROAR_VIO_DSTR_MAX_OBJ_PER_CHAIN]; 
     373 char * dstr_copy; 
    373374 char * next; 
    374375 char * this; 
     
    387388  return -1; 
    388389 
    389  if ( (dstr = roar_mm_strdup(dstr)) == NULL ) 
     390 if ( (dstr_copy = roar_mm_strdup(dstr)) == NULL ) 
    390391  return -1; 
    391392 
     
    394395 chain[0].type = ROAR_VIO_DSTR_OBJT_INTERNAL; 
    395396 
    396  next = dstr; 
     397 next = dstr_copy; 
    397398 
    398399 while (next != NULL) { 
Note: See TracChangeset for help on using the changeset viewer.