Changeset 5227:beb26bba0901 in roaraudio for libroar


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()

Location:
libroar
Files:
2 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) { 
  • libroar/vs.c

    r5199 r5227  
    408408} 
    409409 
    410 int roar_vs_file_simple(roar_vs_t * vss, char * filename, int * error) { 
     410int roar_vs_file_simple(roar_vs_t * vss, const char * filename, int * error) { 
    411411 struct roar_vio_defaults def; 
    412412 struct roar_vio_calls * file; 
     
    495495} 
    496496 
    497 roar_vs_t * roar_vs_new_from_file(const char * server, const char * name, char * filename, int * error) { 
     497roar_vs_t * roar_vs_new_from_file(const char * server, const char * name, const char * filename, int * error) { 
    498498 roar_vs_t * vss = roar_vs_new(server, name, error); 
    499499 
Note: See TracChangeset for help on using the changeset viewer.