Ticket #18381: mp3fs-0.13-macosx.patch

File mp3fs-0.13-macosx.patch, 3.7 KB (added by mail@…, 15 years ago)
  • src/class.h

    diff -u -r mp3fs-0.13/src/class.h mp3fs-0.13.org/src/class.h
    old new  
    171171
    172172#define CLASS(class,super_class)                        \
    173173  typedef struct class *class;                          \
    174   /*inline*/ void class ## _init(void);                 \
     174  inline void class ## _init(void);                     \
    175175  void class ## _Alloc(class this);                     \
    176176  extern int __ ## class ## _initialised;               \
    177177  extern struct class __ ## class;                      \
     
    209209
    210210#define VIRTUAL(class,superclass)                               \
    211211  struct class __ ## class;                                     \
    212   /*inline*/ void class ## _init(void) {                                        \
     212  inline void class ## _init(void) {                                    \
    213213    if(!__ ## class ## _initialised) {                                  \
    214214      class ## _Alloc(&__ ## class);                                    \
    215215      __ ## class ## _initialised = 1;                                  \
     
    233233
    234234#define VIRTUAL(class,superclass)                               \
    235235  struct class __ ## class;                                     \
    236   /*inline*/ void class ## _init(void) {                                        \
     236  inline void class ## _init(void) {                                    \
    237237    if(!__ ## class ## _initialised) {                                  \
    238238      class ## _Alloc(&__ ## class);                                    \
    239239      __ ## class ## _initialised = 1;                                  \
     
    348348#define GET_CLASS(name)                         \
    349349  &__ ## name
    350350
    351 /*inline*/ void Object_init(void);
    352 /*inline*/ void Object_Alloc(Object this);
     351inline void Object_init(void);
     352inline void Object_Alloc(Object this);
    353353
    354354extern struct Object __Object;
    355355
  • src/mp3fs.c

    diff -u -r mp3fs-0.13/src/mp3fs.c mp3fs-0.13.org/src/mp3fs.c
    old new  
    2020  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2121*/
    2222
    23 #define FUSE_USE_VERSION 26
     23#define FUSE_USE_VERSION 22
    2424
    2525#include <fuse.h>
    2626#include <stdio.h>
     
    3030#include <fcntl.h>
    3131#include <dirent.h>
    3232#include <errno.h>
    33 /*#include <sys/statfs.h>*/
     33#include <sys/statfs.h>
    3434
    3535#include "transcode.h"
    3636#include "talloc.h"
     
    5656                         off_t offset, struct fuse_file_info *fi) {
    5757  DIR *dp;
    5858  struct dirent *de;
    59         char name[256]; /* *ptr; */
     59  char name[256], *ptr;
    6060 
    6161  DEBUG(logfd, "%s: readdir\n", path);
    6262
     
    9090}
    9191
    9292static int mp3fs_getattr(const char *path, struct stat *stbuf) {
    93   /* int res; */
     93  int res;
    9494  FileTranscoder f;
    9595  char name[256];
    9696  int hold_errno;
     
    161161static int mp3fs_read(const char *path, char *buf, size_t size, off_t offset,
    162162                      struct fuse_file_info *fi) {
    163163  int fd, res;
    164   /* struct stat st; */
     164  struct stat st;
    165165  FileTranscoder f=NULL;
    166166  char name[256];
    167167
     
    195195  return f->Read(f, buf, offset, size);
    196196}
    197197
    198 static int mp3fs_statfs(const char *path, struct statvfs *stbuf) {
     198static int mp3fs_statfs(const char *path, struct statfs *stbuf) {
    199199  int res;
    200200  char name[256];
    201201
     
    204204  strncpy(name, basepath, sizeof(name));
    205205  strncat(name, path, sizeof(name) - strlen(name));
    206206
    207   res = statvfs(name, stbuf);
     207  res = statfs(name, stbuf);
    208208  if(res == -1)
    209209    return -errno;
    210210 
     
    269269#endif
    270270 
    271271  // start FUSE
    272   fuse_main(argc-1, argv+1, &mp3fs_ops, NULL);
     272  fuse_main(argc-1, argv+1, &mp3fs_ops);
    273273 
    274274#ifdef __DEBUG__
    275275  fclose(logfd);
  • src/transcode.c

    diff -u -r mp3fs-0.13/src/transcode.c mp3fs-0.13.org/src/transcode.c
    old new  
    2424#include <fcntl.h>
    2525#include <dirent.h>
    2626#include <errno.h>
    27 /*#include <sys/statfs.h>*/
     27#include <sys/statfs.h>
    2828
    2929#include <FLAC/metadata.h>
    3030#ifdef LEGACY_FLAC
     
    159159                                        void *client_data)
    160160#endif
    161161{
    162   int len, i/*, count*/;
     162  int len, i, count;
    163163  FileTranscoder trans = (FileTranscoder)client_data;
    164164 
    165165  if(frame->header.blocksize < 1152) {