patches/wildmidi-02-sunstudio.diff
author trisk
Thu, 17 Sep 2009 23:37:46 +0000
changeset 2176 65fca22d82a7
parent 1923 48fdf7d99a3b
child 3079 c5d5fc0dff69
permissions -rw-r--r--
2009-09-17 Albert Lee <[email protected]> * patches/wildmidi-01-solaris.diff: Remove old Studio fix * patches/wildmidi-02-sunstudio.diff: Fix additional build system issues
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2176
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
     1
--- wildmidi-0.2.2.orig/configure.ac	2004-01-28 13:25:44.000000000 -0500
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
     2
+++ wildmidi-0.2.2/configure.ac	2009-09-17 17:33:28.773882786 -0400
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
     3
@@ -44,12 +44,9 @@
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
     4
 AM_PROG_LIBTOOL
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
     5
 
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
     6
 
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
     7
-set $CC
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
     8
-if test "$1" = gcc; then
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
     9
-	shift
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    10
-	args="$*"
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    11
+if test "$GCC" = "yes"; then
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    12
 	AC_MSG_CHECKING(for gcc version)
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    13
-	CCVER="gcc `gcc --version`"
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    14
+	CCVER="gcc `$CC --version`"
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    15
 	AC_MSG_RESULT($CCVER)
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    16
 fi
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    17
 
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    18
@@ -95,14 +92,16 @@
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    19
 
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    20
 AC_C_BIGENDIAN
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    21
 
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    22
-CFLAGS="$CFLAGS -Wall"
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    23
+if test "$GCC" = "yes"; then
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    24
+	CFLAGS="$CFLAGS -Wall"
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    25
+fi
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    26
 AC_ARG_ENABLE(werror,
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    27
     [  --disable-werror      disable fail on compile warnings],    werror=$enable_werror,
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    28
 	werror=yes
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    29
 )
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    30
 
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    31
 AC_MSG_CHECKING(for Werror)
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    32
-if test "x$werror" = xyes; then
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    33
+if test "x$werror" = xyes -a "$GCC" = "yes"; then
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    34
 	AC_MSG_RESULT(yes)
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    35
 	CFLAGS="$CFLAGS -Werror"
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    36
 else 
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    37
@@ -170,7 +169,7 @@
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    38
 	[  --enable-profile        compile with profiling (for development)],
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    39
 	profile=$enable_profile
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    40
 )
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    41
-if test "x$profile" = xyes; then
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    42
+if test "x$profile" = xyes -a "$GCC" = "yes"; then
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    43
 	BUILD_TYPE="$BUILD_TYPE Profile"
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    44
 	CFLAGS="`echo $CFLAGS | sed -e 's/-fomit-frame-pointer//g'` -pg -fprofile-arcs"
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    45
 	LDFLAGS="$LDFLAGS -pg -fprofile-arcs"
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    46
@@ -180,7 +179,7 @@
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    47
 	[  --enable-temps        compile with save-temps],
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    48
 	temps=$enable_temps
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    49
 )
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    50
-if test "x$temps" = xyes; then
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    51
+if test "x$temps" = xyes -a "$GCC" = "yes"; then
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    52
 	CFLAGS="$CFLAGS -save-temps"
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    53
 fi
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    54
 
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    55
@@ -227,18 +226,22 @@
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    56
 
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    57
 case "$arch" in
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    58
 	auto)
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    59
-		case "${host_cpu}" in
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    60
-			i?86)
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    61
-				if test "x$HAVE_AMD" = "xyes"; then
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    62
-					CFLAGS="$CFLAGS -march=k6"
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    63
-				else
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    64
-					CFLAGS="$CFLAGS -march=${host_cpu}"
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    65
-				fi
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    66
-				;;
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    67
-		esac
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    68
+		if test "$GCC" = "yes"; then
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    69
+			case "${host_cpu}" in
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    70
+				i?86)
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    71
+					if test "x$HAVE_AMD" = "xyes"; then
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    72
+						CFLAGS="$CFLAGS -march=k6"
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    73
+					else
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    74
+						CFLAGS="$CFLAGS -march=${host_cpu}"
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    75
+					fi
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    76
+					;;
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    77
+			esac
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    78
+		fi
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    79
 		;;
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    80
 	*)
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    81
-		CFLAGS="$CFLAGS -march=$arch"
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    82
+		if test "$GCC" = "yes"; then
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    83
+			CFLAGS="$CFLAGS -march=$arch"
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    84
+		fi
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    85
 		;;
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    86
 									
65fca22d82a7 2009-09-17 Albert Lee <[email protected]>
trisk
parents: 1923
diff changeset
    87
 esac
1923
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
    88
--- wildmidi-0.2.2/src/wildmidi_lib.c	2009-06-13 19:01:17.737707714 +0200
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
    89
+++ wildmidi-0.2.2-patch/src/wildmidi_lib.c	2009-06-13 19:01:14.950440156 +0200
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
    90
@@ -584,8 +584,8 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
    91
 	char *buffer_file = malloc(strlen(filename) + 1);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
    92
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
    93
 	if (buffer_file == NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
    94
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, NULL, errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
    95
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, filename, errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
    96
+		WM_ERROR(__func__, __LINE__, WM_ERR_MEM, NULL, errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
    97
+		WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, filename, errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
    98
 		return NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
    99
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   100
 	
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   101
@@ -600,8 +600,8 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   102
 		if (home) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   103
 			buffer_file = realloc(buffer_file,(strlen(buffer_file) + strlen(home) + 1));
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   104
 			if (buffer_file == NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   105
-				WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, NULL, errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   106
-				WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, filename, errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   107
+				WM_ERROR(__func__, __LINE__, WM_ERR_MEM, NULL, errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   108
+				WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, filename, errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   109
 				free(buffer_file);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   110
 				return NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   111
 			}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   112
@@ -616,8 +616,8 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   113
 		}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   114
 		buffer_file = realloc(buffer_file,(strlen(buffer_file) + strlen(buffer_dir) + 1));
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   115
 		if (buffer_file == NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   116
-			WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, NULL, errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   117
-			WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, filename, errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   118
+			WM_ERROR(__func__, __LINE__, WM_ERR_MEM, NULL, errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   119
+			WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, filename, errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   120
 			free(buffer_file);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   121
 			return NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   122
 		}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   123
@@ -626,15 +626,15 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   124
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   125
 #endif
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   126
 	if (stat(buffer_file,&buffer_stat)) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   127
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_STAT, filename, errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   128
+		WM_ERROR(__func__, __LINE__, WM_ERR_STAT, filename, errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   129
 		free(buffer_file);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   130
 		return NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   131
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   132
 	*size = buffer_stat.st_size;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   133
 	data = malloc(*size);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   134
 	if (data == NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   135
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, NULL, errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   136
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, filename, errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   137
+		WM_ERROR(__func__, __LINE__, WM_ERR_MEM, NULL, errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   138
+		WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, filename, errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   139
 		free(buffer_file);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   140
 		return NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   141
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   142
@@ -643,13 +643,13 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   143
 #else
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   144
 	if ((buffer_fd = open(buffer_file,O_RDONLY)) == -1) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   145
 #endif
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   146
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_OPEN, filename, errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   147
+		WM_ERROR(__func__, __LINE__, WM_ERR_OPEN, filename, errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   148
 		free(buffer_file);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   149
 		free(data);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   150
 		return NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   151
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   152
 	if (read(buffer_fd,data,*size) != buffer_stat.st_size) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   153
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_READ, filename, errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   154
+		WM_ERROR(__func__, __LINE__, WM_ERR_READ, filename, errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   155
 		free(buffer_file);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   156
 		free(data);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   157
 		close(buffer_fd);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   158
@@ -749,8 +749,8 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   159
 	if (dir_end != NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   160
 		config_dir = malloc((dir_end - config_file + 2));
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   161
 		if (config_dir == NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   162
-			WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to parse config", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   163
-			WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, config_file, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   164
+			WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to parse config", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   165
+			WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, config_file, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   166
 			WM_FreePatches();
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   167
 			free (config_buffer);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   168
 			return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   169
@@ -791,8 +791,8 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   170
 		// copy line into a workable buffer
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   171
 		line_buffer = realloc(line_buffer, (config_ptr - line_start_ptr + 1));
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   172
 		if (line_buffer == NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   173
-			WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to parse config", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   174
-			WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, config_file, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   175
+			WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to parse config", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   176
+			WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, config_file, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   177
 			WM_FreePatches();
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   178
 			if (config_dir != NULL)
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   179
 				free(config_dir);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   180
@@ -822,8 +822,8 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   181
 			if (line_buffer[strlen(line_buffer) - 1] == '/') {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   182
 				config_dir = realloc(config_dir, strlen(&line_buffer[4]) + 1);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   183
 				if (config_dir == NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   184
-					WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to parse config", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   185
-					WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, config_file, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   186
+					WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to parse config", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   187
+					WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, config_file, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   188
 					WM_FreePatches();
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   189
 					free (line_buffer);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   190
 					free (config_buffer);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   191
@@ -833,8 +833,8 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   192
 			} else {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   193
 				config_dir = realloc(config_dir, strlen(&line_buffer[4]) + 2);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   194
 				if (config_dir == NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   195
-					WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to parse config", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   196
-					WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, config_file, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   197
+					WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to parse config", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   198
+					WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, config_file, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   199
 					WM_FreePatches();
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   200
 					free (line_buffer);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   201
 					free (config_buffer);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   202
@@ -848,8 +848,8 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   203
 			if (config_dir != NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   204
 				new_config = malloc(strlen(config_dir) + strlen(&line_buffer[7]) + 1);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   205
 				if (new_config == NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   206
-					WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to parse config", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   207
-					WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, config_file, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   208
+					WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to parse config", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   209
+					WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, config_file, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   210
 					WM_FreePatches();
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   211
 					free (config_dir);	
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   212
 					free (line_buffer);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   213
@@ -861,8 +861,8 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   214
 			} else {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   215
 				new_config = malloc(strlen(&line_buffer[7]) + 1);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   216
 				if (new_config == NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   217
-					WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to parse config", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   218
-					WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, config_file, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   219
+					WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to parse config", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   220
+					WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, config_file, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   221
 					WM_FreePatches();
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   222
 					free (line_buffer);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   223
 					free (config_buffer);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   224
@@ -882,8 +882,8 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   225
 			continue;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   226
 		} else if (strncasecmp(line_buffer, "bank ", 5) == 0) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   227
 			if (!isdigit(line_buffer[5])) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   228
-				WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(syntax error in bank line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   229
-				WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, config_file, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   230
+				WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(syntax error in bank line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   231
+				WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, config_file, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   232
 				WM_FreePatches();
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   233
 				if (config_dir != NULL)
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   234
 					free (config_dir);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   235
@@ -895,8 +895,8 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   236
 			continue;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   237
 		} else if (strncasecmp(line_buffer, "drumset ", 8) == 0) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   238
 			if (!isdigit(line_buffer[8])) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   239
-				WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(syntax error in drumset line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   240
-				WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, config_file, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   241
+				WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(syntax error in drumset line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   242
+				WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, config_file, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   243
 				WM_FreePatches();
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   244
 				if (config_dir != NULL)
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   245
 					free (config_dir);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   246
@@ -911,8 +911,8 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   247
 			if (patch[(patchid & 0x7F)] == NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   248
 				patch[(patchid & 0x7F)] = malloc (sizeof(struct _patch));
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   249
 				if (patch[(patchid & 0x7F)] == NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   250
-					WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, NULL, errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   251
-					WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, config_file, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   252
+					WM_ERROR(__func__, __LINE__, WM_ERR_MEM, NULL, errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   253
+					WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, config_file, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   254
 					WM_FreePatches();
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   255
 					if (config_dir != NULL)
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   256
 						free (config_dir);	
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   257
@@ -946,8 +946,8 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   258
 						if (tmp_patch->next == NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   259
 							tmp_patch->next = malloc (sizeof(struct _patch));
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   260
 							if (tmp_patch->next == NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   261
-								WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, NULL, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   262
-								WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, config_file, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   263
+								WM_ERROR(__func__, __LINE__, WM_ERR_MEM, NULL, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   264
+								WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, config_file, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   265
 								WM_FreePatches();
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   266
 								if (config_dir != NULL)
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   267
 									free (config_dir);	
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   268
@@ -974,8 +974,8 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   269
 					} else {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   270
 						tmp_patch->next = malloc (sizeof(struct _patch));
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   271
 						if (tmp_patch->next == NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   272
-							WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, NULL, errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   273
-							WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, config_file, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   274
+							WM_ERROR(__func__, __LINE__, WM_ERR_MEM, NULL, errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   275
+							WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, config_file, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   276
 							WM_FreePatches();
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   277
 							if (config_dir != NULL)
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   278
 								free (config_dir);	
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   279
@@ -998,8 +998,8 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   280
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   281
 			chr_ptr = strchr(line_buffer,' ') + 1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   282
 			if (chr_ptr == NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   283
-				WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   284
-				WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, config_file, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   285
+				WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   286
+				WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, config_file, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   287
 				WM_FreePatches();
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   288
 				if (config_dir != NULL)
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   289
 					free (config_dir);	
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   290
@@ -1016,8 +1016,8 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   291
 				if (config_dir != NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   292
 					tmp_patch->filename = malloc(strlen(config_dir) + strlen(&line_buffer[line_ptr]) + 5);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   293
 					if (tmp_patch->filename == NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   294
-						WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, NULL, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   295
-						WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, config_file, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   296
+						WM_ERROR(__func__, __LINE__, WM_ERR_MEM, NULL, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   297
+						WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, config_file, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   298
 						WM_FreePatches();
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   299
 						if (config_dir != NULL)
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   300
 							free (config_dir);	
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   301
@@ -1030,8 +1030,8 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   302
 				} else {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   303
 					tmp_patch->filename = malloc(strlen(&line_buffer[line_ptr]) + 5);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   304
 					if (tmp_patch->filename == NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   305
-						WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, NULL, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   306
-						WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, config_file, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   307
+						WM_ERROR(__func__, __LINE__, WM_ERR_MEM, NULL, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   308
+						WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, config_file, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   309
 						WM_FreePatches();
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   310
 						free (line_buffer);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   311
 						free (config_buffer);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   312
@@ -1044,8 +1044,8 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   313
 				if (config_dir != NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   314
 					tmp_patch->filename = malloc(strlen(config_dir) + strlen(&line_buffer[line_ptr]) + 1);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   315
 					if (tmp_patch->filename == NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   316
-						WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, NULL, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   317
-						WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, config_file, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   318
+						WM_ERROR(__func__, __LINE__, WM_ERR_MEM, NULL, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   319
+						WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, config_file, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   320
 						WM_FreePatches();
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   321
 						if (config_dir != NULL)
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   322
 							free (config_dir);	
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   323
@@ -1058,8 +1058,8 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   324
 				} else {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   325
 					tmp_patch->filename = malloc(strlen(&line_buffer[line_ptr]) + 1);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   326
 					if (tmp_patch->filename == NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   327
-						WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, NULL, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   328
-						WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, config_file, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   329
+						WM_ERROR(__func__, __LINE__, WM_ERR_MEM, NULL, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   330
+						WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, config_file, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   331
 						WM_FreePatches();
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   332
 						free (line_buffer);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   333
 						free (config_buffer);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   334
@@ -1083,7 +1083,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   335
 				chr_ptr = strstr(&line_buffer[line_ptr], "amp=");
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   336
 				if (chr_ptr != NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   337
 					if (!isdigit(chr_ptr[4])) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   338
-						WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   339
+						WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   340
 					} else {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   341
 						tmp_patch->amp = ((atoi(&chr_ptr[4]) << 10) / 100);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   342
 					}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   343
@@ -1091,7 +1091,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   344
 				chr_ptr = strstr(&line_buffer[line_ptr], "note=");
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   345
 				if (chr_ptr != NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   346
 					if (!isdigit(chr_ptr[5])) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   347
-						WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   348
+						WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   349
 					} else {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   350
 						tmp_patch->note = atoi(&chr_ptr[5]);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   351
 					}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   352
@@ -1111,11 +1111,11 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   353
 				chr_ptr = strstr(&line_buffer[line_ptr], "env_time0=");
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   354
 				if (chr_ptr != NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   355
 					if (!isdigit(chr_ptr[10])) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   356
-						WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   357
+						WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   358
 					} else {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   359
 						tmp_patch->env[0].time = atof(&chr_ptr[10]);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   360
 						if ((tmp_patch->env[0].time > 45000.0) || (tmp_patch->env[0].time < 1.47)) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   361
-							WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   362
+							WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   363
 							tmp_patch->env[0].set &= 0xFE;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   364
 						} else {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   365
 							tmp_patch->env[0].set |= 0x01;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   366
@@ -1126,11 +1126,11 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   367
 				chr_ptr = strstr(&line_buffer[line_ptr], "env_time1=");
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   368
 				if (chr_ptr != NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   369
 					if (!isdigit(chr_ptr[10])) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   370
-						WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   371
+						WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   372
 					} else {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   373
 						tmp_patch->env[1].time = atof(&chr_ptr[10]);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   374
 						if ((tmp_patch->env[1].time > 45000.0) || (tmp_patch->env[1].time < 1.47)) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   375
-							WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   376
+							WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   377
 							tmp_patch->env[1].set &= 0xFE;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   378
 						} else {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   379
 							tmp_patch->env[1].set |= 0x01;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   380
@@ -1140,11 +1140,11 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   381
 				chr_ptr = strstr(&line_buffer[line_ptr], "env_time2=");
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   382
 				if (chr_ptr != NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   383
 					if (!isdigit(chr_ptr[10])) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   384
-						WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   385
+						WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   386
 					} else {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   387
 						tmp_patch->env[2].time = atof(&chr_ptr[10]);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   388
 						if ((tmp_patch->env[2].time > 45000.0) || (tmp_patch->env[2].time < 1.47)) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   389
-							WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   390
+							WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   391
 							tmp_patch->env[2].set &= 0xFE;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   392
 						} else {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   393
 							tmp_patch->env[2].set |= 0x01;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   394
@@ -1154,11 +1154,11 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   395
 				chr_ptr = strstr(&line_buffer[line_ptr], "env_time3=");
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   396
 				if (chr_ptr != NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   397
 					if (!isdigit(chr_ptr[10])) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   398
-						WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   399
+						WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   400
 					} else {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   401
 						tmp_patch->env[3].time = atof(&chr_ptr[10]);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   402
 						if ((tmp_patch->env[3].time > 45000.0) || (tmp_patch->env[3].time < 1.47)) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   403
-							WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   404
+							WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   405
 							tmp_patch->env[3].set &= 0xFE;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   406
 						} else {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   407
 							tmp_patch->env[3].set |= 0x01;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   408
@@ -1168,11 +1168,11 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   409
 				chr_ptr = strstr(&line_buffer[line_ptr], "env_time4=");
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   410
 				if (chr_ptr != NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   411
 					if (!isdigit(chr_ptr[10])) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   412
-						WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   413
+						WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   414
 					} else {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   415
 						tmp_patch->env[4].time = atof(&chr_ptr[10]);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   416
 						if ((tmp_patch->env[4].time > 45000.0) || (tmp_patch->env[4].time < 1.47)) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   417
-							WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   418
+							WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   419
 							tmp_patch->env[4].set &= 0xFE;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   420
 						} else {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   421
 							tmp_patch->env[4].set |= 0x01;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   422
@@ -1182,11 +1182,11 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   423
 				chr_ptr = strstr(&line_buffer[line_ptr], "env_time5=");
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   424
 				if (chr_ptr != NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   425
 					if (!isdigit(chr_ptr[10])) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   426
-						WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   427
+						WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   428
 					} else {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   429
 						tmp_patch->env[5].time = atof(&chr_ptr[10]);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   430
 						if ((tmp_patch->env[5].time > 45000.0) || (tmp_patch->env[5].time < 1.47)) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   431
-							WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   432
+							WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   433
 							tmp_patch->env[5].set &= 0xFE;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   434
 						} else {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   435
 							tmp_patch->env[5].set |= 0x01;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   436
@@ -1196,11 +1196,11 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   437
 				chr_ptr = strstr(&line_buffer[line_ptr], "env_level0=");
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   438
 				if (chr_ptr != NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   439
 					if (!isdigit(chr_ptr[11])) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   440
-						WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   441
+						WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   442
 					} else {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   443
 						tmp_patch->env[0].level = atof(&chr_ptr[10]);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   444
 						if ((tmp_patch->env[0].level > 1.0) || (tmp_patch->env[0].level < 0.0)) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   445
-							WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   446
+							WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   447
 							tmp_patch->env[0].set &= 0xFD;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   448
 						} else {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   449
 							tmp_patch->env[0].set |= 0x02;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   450
@@ -1211,11 +1211,11 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   451
 				chr_ptr = strstr(&line_buffer[line_ptr], "env_level1=");
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   452
 				if (chr_ptr != NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   453
 					if (!isdigit(chr_ptr[11])) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   454
-						WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   455
+						WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   456
 					} else {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   457
 						tmp_patch->env[1].level = atof(&chr_ptr[10]);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   458
 						if ((tmp_patch->env[1].level > 1.0) || (tmp_patch->env[1].level < 0.0)) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   459
-							WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   460
+							WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   461
 							tmp_patch->env[1].set &= 0xFD;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   462
 						} else {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   463
 							tmp_patch->env[1].set |= 0x02;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   464
@@ -1225,11 +1225,11 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   465
 				chr_ptr = strstr(&line_buffer[line_ptr], "env_level2=");
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   466
 				if (chr_ptr != NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   467
 					if (!isdigit(chr_ptr[11])) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   468
-						WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   469
+						WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   470
 					} else {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   471
 						tmp_patch->env[2].level = atof(&chr_ptr[10]);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   472
 						if ((tmp_patch->env[2].level > 1.0) || (tmp_patch->env[2].level < 0.0)) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   473
-							WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   474
+							WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   475
 							tmp_patch->env[2].set &= 0xFD;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   476
 						} else {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   477
 							tmp_patch->env[2].set |= 0x02;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   478
@@ -1239,11 +1239,11 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   479
 				chr_ptr = strstr(&line_buffer[line_ptr], "env_level3=");
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   480
 				if (chr_ptr != NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   481
 					if (!isdigit(chr_ptr[11])) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   482
-						WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   483
+						WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   484
 					} else {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   485
 						tmp_patch->env[3].level = atof(&chr_ptr[10]);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   486
 						if ((tmp_patch->env[3].level > 1.0) || (tmp_patch->env[3].level < 0.0)) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   487
-							WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   488
+							WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   489
 							tmp_patch->env[3].set &= 0xFD;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   490
 						} else {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   491
 							tmp_patch->env[3].set |= 0x02;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   492
@@ -1253,11 +1253,11 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   493
 				chr_ptr = strstr(&line_buffer[line_ptr], "env_level4=");
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   494
 				if (chr_ptr != NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   495
 					if (!isdigit(chr_ptr[11])) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   496
-						WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   497
+						WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   498
 					} else {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   499
 						tmp_patch->env[4].level = atof(&chr_ptr[10]);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   500
 						if ((tmp_patch->env[4].level > 1.0) || (tmp_patch->env[4].level < 0.0)) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   501
-							WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   502
+							WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   503
 							tmp_patch->env[4].set &= 0xFD;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   504
 						} else {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   505
 							tmp_patch->env[4].set |= 0x02;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   506
@@ -1267,11 +1267,11 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   507
 				chr_ptr = strstr(&line_buffer[line_ptr], "env_level5=");
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   508
 				if (chr_ptr != NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   509
 					if (!isdigit(chr_ptr[11])) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   510
-						WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   511
+						WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   512
 					} else {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   513
 						tmp_patch->env[5].level = atof(&chr_ptr[10]);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   514
 						if ((tmp_patch->env[5].level > 1.0) || (tmp_patch->env[5].level < 0.0)) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   515
-							WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   516
+							WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   517
 							tmp_patch->env[5].set &= 0xFD;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   518
 						} else {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   519
 							tmp_patch->env[5].set |= 0x02;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   520
@@ -1306,7 +1306,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   521
 	unsigned char *read_end = data + gus_sample->data_length;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   522
 	signed short int *write_data = NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   523
 	
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   524
-	SAMPLE_CONVERT_DEBUG(__FUNCTION__);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   525
+	SAMPLE_CONVERT_DEBUG(__func__);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   526
 	gus_sample->data = calloc((gus_sample->data_length + 1), sizeof(signed short int));
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   527
 	if (__builtin_expect((gus_sample->data != NULL),1)) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   528
 		write_data = gus_sample->data;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   529
@@ -1322,7 +1322,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   530
 		return 0;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   531
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   532
 	
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   533
-	WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   534
+	WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   535
 	return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   536
 }
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   537
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   538
@@ -1338,7 +1338,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   539
 	signed short int *write_data_a = NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   540
 	signed short int *write_data_b = NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   541
 	
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   542
-	SAMPLE_CONVERT_DEBUG(__FUNCTION__);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   543
+	SAMPLE_CONVERT_DEBUG(__func__);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   544
 	gus_sample->data = calloc((new_length + 1), sizeof(signed short int));
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   545
 	if (__builtin_expect((gus_sample->data != NULL),1)) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   546
 		write_data = gus_sample->data;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   547
@@ -1391,7 +1391,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   548
 		return 0;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   549
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   550
 	
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   551
-	WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   552
+	WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   553
 	return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   554
 }
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   555
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   556
@@ -1403,7 +1403,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   557
 	signed short int *write_data = NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   558
 	unsigned long int tmp_loop = 0;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   559
 	
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   560
-	SAMPLE_CONVERT_DEBUG(__FUNCTION__);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   561
+	SAMPLE_CONVERT_DEBUG(__func__);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   562
 	gus_sample->data = calloc((gus_sample->data_length + 1), sizeof(signed short int));
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   563
 	if (__builtin_expect((gus_sample->data != NULL),1)) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   564
 		write_data = gus_sample->data + gus_sample->data_length - 1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   565
@@ -1423,7 +1423,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   566
 		gus_sample->modes ^= SAMPLE_REVERSE;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   567
 		return 0;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   568
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   569
-	WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   570
+	WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   571
 	return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   572
 }
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   573
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   574
@@ -1440,7 +1440,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   575
 	signed short int *write_data_a = NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   576
 	signed short int *write_data_b = NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   577
 	
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   578
-	SAMPLE_CONVERT_DEBUG(__FUNCTION__);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   579
+	SAMPLE_CONVERT_DEBUG(__func__);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   580
 	gus_sample->data = calloc((new_length + 1), sizeof(signed short int));
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   581
 	if (__builtin_expect((gus_sample->data != NULL),1)) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   582
 		write_data = gus_sample->data;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   583
@@ -1491,7 +1491,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   584
 		return 0;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   585
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   586
 	
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   587
-	WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   588
+	WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   589
 	return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   590
 }
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   591
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   592
@@ -1502,7 +1502,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   593
 	unsigned char *read_end = data + gus_sample->data_length;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   594
 	signed short int *write_data = NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   595
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   596
-	SAMPLE_CONVERT_DEBUG(__FUNCTION__);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   597
+	SAMPLE_CONVERT_DEBUG(__func__);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   598
 	gus_sample->data = calloc((gus_sample->data_length + 1), sizeof(signed short int));
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   599
 	if (__builtin_expect((gus_sample->data != NULL),1)) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   600
 		write_data = gus_sample->data;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   601
@@ -1518,7 +1518,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   602
 		gus_sample->modes ^= SAMPLE_UNSIGNED;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   603
 		return 0;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   604
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   605
-	WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   606
+	WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   607
 	return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   608
 }
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   609
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   610
@@ -1534,7 +1534,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   611
 	signed short int *write_data_a = NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   612
 	signed short int *write_data_b = NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   613
 	
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   614
-	SAMPLE_CONVERT_DEBUG(__FUNCTION__);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   615
+	SAMPLE_CONVERT_DEBUG(__func__);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   616
 	gus_sample->data = calloc((new_length + 1), sizeof(signed short int));
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   617
 	if (__builtin_expect((gus_sample->data != NULL),1)) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   618
 		write_data = gus_sample->data;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   619
@@ -1587,7 +1587,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   620
 		return 0;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   621
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   622
 	
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   623
-	WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   624
+	WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   625
 	return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   626
 }
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   627
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   628
@@ -1599,7 +1599,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   629
 	signed short int *write_data = NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   630
 	unsigned long int tmp_loop = 0;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   631
 	
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   632
-	SAMPLE_CONVERT_DEBUG(__FUNCTION__);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   633
+	SAMPLE_CONVERT_DEBUG(__func__);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   634
 	gus_sample->data = calloc((gus_sample->data_length + 1), sizeof(signed short int));
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   635
 	if (__builtin_expect((gus_sample->data != NULL),1)) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   636
 		write_data = gus_sample->data + gus_sample->data_length - 1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   637
@@ -1619,7 +1619,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   638
 		gus_sample->modes ^= SAMPLE_REVERSE | SAMPLE_UNSIGNED;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   639
 		return 0;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   640
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   641
-	WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   642
+	WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   643
 	return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   644
 }
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   645
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   646
@@ -1635,7 +1635,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   647
 	signed short int *write_data_a = NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   648
 	signed short int *write_data_b = NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   649
 	
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   650
-	SAMPLE_CONVERT_DEBUG(__FUNCTION__);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   651
+	SAMPLE_CONVERT_DEBUG(__func__);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   652
 	gus_sample->data = calloc((new_length + 1), sizeof(signed short int));
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   653
 	if (__builtin_expect((gus_sample->data != NULL),1)) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   654
 		write_data = gus_sample->data;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   655
@@ -1686,7 +1686,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   656
 		return 0;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   657
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   658
 	
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   659
-	WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   660
+	WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   661
 	return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   662
 }
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   663
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   664
@@ -1697,7 +1697,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   665
 	unsigned char *read_end = data + gus_sample->data_length;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   666
 	signed short int *write_data = NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   667
 	
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   668
-	SAMPLE_CONVERT_DEBUG(__FUNCTION__);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   669
+	SAMPLE_CONVERT_DEBUG(__func__);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   670
 	gus_sample->data = calloc(((gus_sample->data_length >> 1) + 1),sizeof(signed short int));
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   671
 	if (__builtin_expect((gus_sample->data != NULL),1)) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   672
 		write_data = gus_sample->data;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   673
@@ -1717,7 +1717,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   674
 		gus_sample->data_length >>= 1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   675
 		return 0;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   676
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   677
-	WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   678
+	WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   679
 	return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   680
 }	
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   681
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   682
@@ -1733,7 +1733,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   683
 	signed short int *write_data_a = NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   684
 	signed short int *write_data_b = NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   685
 	
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   686
-	SAMPLE_CONVERT_DEBUG(__FUNCTION__);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   687
+	SAMPLE_CONVERT_DEBUG(__func__);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   688
 	gus_sample->data = calloc(((new_length >> 1) + 1), sizeof(signed short int));
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   689
 	if (__builtin_expect((gus_sample->data != NULL),1)) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   690
 		write_data = gus_sample->data;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   691
@@ -1794,7 +1794,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   692
 		return 0;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   693
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   694
 	
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   695
-	WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   696
+	WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   697
 	return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   698
 }
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   699
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   700
@@ -1806,7 +1806,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   701
 	signed short int *write_data = NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   702
 	unsigned long int tmp_loop = 0;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   703
 	
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   704
-	SAMPLE_CONVERT_DEBUG(__FUNCTION__);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   705
+	SAMPLE_CONVERT_DEBUG(__func__);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   706
 	gus_sample->data = calloc(((gus_sample->data_length >> 1) + 1), sizeof(signed short int));
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   707
 	if (__builtin_expect((gus_sample->data != NULL),1)) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   708
 		write_data = gus_sample->data + (gus_sample->data_length >> 1) - 1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   709
@@ -1830,7 +1830,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   710
 		gus_sample->modes ^= SAMPLE_REVERSE;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   711
 		return 0;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   712
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   713
-	WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   714
+	WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   715
 	return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   716
 }
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   717
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   718
@@ -1847,7 +1847,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   719
 	signed short int *write_data_a = NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   720
 	signed short int *write_data_b = NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   721
 	
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   722
-	SAMPLE_CONVERT_DEBUG(__FUNCTION__);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   723
+	SAMPLE_CONVERT_DEBUG(__func__);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   724
 	gus_sample->data = calloc(((new_length >> 1) + 1), sizeof(signed short int));
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   725
 	if (__builtin_expect((gus_sample->data != NULL),1)) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   726
 		write_data = gus_sample->data;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   727
@@ -1904,7 +1904,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   728
 		return 0;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   729
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   730
 	
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   731
-	WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   732
+	WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   733
 	return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   734
 }
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   735
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   736
@@ -1915,7 +1915,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   737
 	unsigned char *read_end = data + gus_sample->data_length;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   738
 	signed short int *write_data = NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   739
 	
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   740
-	SAMPLE_CONVERT_DEBUG(__FUNCTION__);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   741
+	SAMPLE_CONVERT_DEBUG(__func__);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   742
 	gus_sample->data = calloc(((gus_sample->data_length >> 1) + 1),sizeof(signed short int));
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   743
 	if (__builtin_expect((gus_sample->data != NULL),1)) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   744
 		write_data = gus_sample->data;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   745
@@ -1935,7 +1935,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   746
 		gus_sample->modes ^= SAMPLE_UNSIGNED;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   747
 		return 0;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   748
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   749
-	WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   750
+	WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   751
 	return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   752
 }
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   753
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   754
@@ -1951,7 +1951,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   755
 	signed short int *write_data_a = NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   756
 	signed short int *write_data_b = NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   757
 	
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   758
-	SAMPLE_CONVERT_DEBUG(__FUNCTION__);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   759
+	SAMPLE_CONVERT_DEBUG(__func__);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   760
 	gus_sample->data = calloc(((new_length >> 1) + 1), sizeof(signed short int));
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   761
 	if (__builtin_expect((gus_sample->data != NULL),1)) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   762
 		write_data = gus_sample->data;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   763
@@ -2012,7 +2012,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   764
 		return 0;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   765
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   766
 	
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   767
-	WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   768
+	WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   769
 	return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   770
 }
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   771
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   772
@@ -2024,7 +2024,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   773
 	signed short int *write_data = NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   774
 	unsigned long int tmp_loop = 0;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   775
 	
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   776
-	SAMPLE_CONVERT_DEBUG(__FUNCTION__);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   777
+	SAMPLE_CONVERT_DEBUG(__func__);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   778
 	gus_sample->data = calloc(((gus_sample->data_length >> 1) + 1), sizeof(signed short int));
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   779
 	if (__builtin_expect((gus_sample->data != NULL),1)) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   780
 		write_data = gus_sample->data + (gus_sample->data_length >> 1) - 1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   781
@@ -2048,7 +2048,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   782
 		gus_sample->modes ^= SAMPLE_REVERSE | SAMPLE_UNSIGNED;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   783
 		return 0;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   784
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   785
-	WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   786
+	WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   787
 	return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   788
 }
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   789
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   790
@@ -2064,7 +2064,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   791
 	signed short int *write_data_a = NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   792
 	signed short int *write_data_b = NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   793
 	
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   794
-	SAMPLE_CONVERT_DEBUG(__FUNCTION__);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   795
+	SAMPLE_CONVERT_DEBUG(__func__);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   796
 	gus_sample->data = calloc(((new_length >> 1) + 1), sizeof(signed short int));
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   797
 	if (__builtin_expect((gus_sample->data != NULL),1)) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   798
 		write_data = gus_sample->data;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   799
@@ -2120,7 +2120,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   800
 		return 0;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   801
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   802
 	
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   803
-	WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   804
+	WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   805
 	return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   806
 }
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   807
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   808
@@ -2156,33 +2156,33 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   809
 	};
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   810
 	unsigned long int tmp_loop;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   811
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   812
-	SAMPLE_CONVERT_DEBUG(__FUNCTION__);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   813
+	SAMPLE_CONVERT_DEBUG(__func__);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   814
 	SAMPLE_CONVERT_DEBUG(sample_patch->filename);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   815
 	sample_patch->loaded = 1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   816
 	if ((gus_patch = WM_BufferFile(sample_patch->filename,&gus_size)) == NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   817
 		return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   818
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   819
 	if (gus_size < 239) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   820
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_CORUPT, "(too short)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   821
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, sample_patch->filename, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   822
+		WM_ERROR(__func__, __LINE__, WM_ERR_CORUPT, "(too short)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   823
+		WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, sample_patch->filename, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   824
 		free(gus_patch);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   825
 		return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   826
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   827
 	if (memcmp(gus_patch, "GF1PATCH110\0ID#000002", 22) && memcmp(gus_patch, "GF1PATCH100\0ID#000002", 22)) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   828
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID,"(unsupported format)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   829
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, sample_patch->filename, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   830
+		WM_ERROR(__func__, __LINE__, WM_ERR_INVALID,"(unsupported format)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   831
+		WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, sample_patch->filename, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   832
 		free(gus_patch);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   833
 		return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   834
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   835
 	if (gus_patch[82] > 1) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   836
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID,"(unsupported format)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   837
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, sample_patch->filename, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   838
+		WM_ERROR(__func__, __LINE__, WM_ERR_INVALID,"(unsupported format)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   839
+		WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, sample_patch->filename, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   840
 		free(gus_patch);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   841
 		return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   842
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   843
 	if (gus_patch[151] > 1) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   844
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID,"(unsupported format)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   845
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, sample_patch->filename, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   846
+		WM_ERROR(__func__, __LINE__, WM_ERR_INVALID,"(unsupported format)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   847
+		WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, sample_patch->filename, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   848
 		free(gus_patch);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   849
 		return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   850
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   851
@@ -2200,8 +2200,8 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   852
 			gus_sample = gus_sample->next;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   853
 		}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   854
 		if (gus_sample == NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   855
-			WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, NULL, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   856
-			WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, sample_patch->filename, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   857
+			WM_ERROR(__func__, __LINE__, WM_ERR_MEM, NULL, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   858
+			WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, sample_patch->filename, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   859
 			return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   860
 		}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   861
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   862
@@ -2259,7 +2259,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   863
 				} else {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   864
 					gus_sample->env_rate[i]  = (unsigned long int)(4194303.0 / ((float)WM_SampleRate * env_time_table[env_rate]));
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   865
 					if (gus_sample->env_rate[i] == 0) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   866
-						fprintf(stderr,"\rWarning: libWildMidi %s found invalid envelope(%lu) rate setting in %s. Using %f instead.\n",__FUNCTION__, i, sample_patch->filename, env_time_table[63]);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   867
+						fprintf(stderr,"\rWarning: libWildMidi %s found invalid envelope(%lu) rate setting in %s. Using %f instead.\n",__func__, i, sample_patch->filename, env_time_table[63]);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   868
 						gus_sample->env_rate[i]  = (unsigned long int)(4194303.0 / ((float)WM_SampleRate * env_time_table[63]));
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   869
 					}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   870
 				}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   871
@@ -2420,7 +2420,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   872
 			var_data |= mdi->data[track->ptr] & 0x7f;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   873
 			track->ptr++;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   874
 			if (track->ptr > mdi->size) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   875
-				WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_CORUPT, "(too short)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   876
+				WM_ERROR(__func__, __LINE__, WM_ERR_CORUPT, "(too short)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   877
 				return 0xFFFFFFFF;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   878
 			}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   879
 			var_data = (var_data << 7);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   880
@@ -2430,7 +2430,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   881
 	track->ptr++;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   882
 	
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   883
 	if (track->ptr > mdi->size) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   884
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_CORUPT, "(too short)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   885
+		WM_ERROR(__func__, __LINE__, WM_ERR_CORUPT, "(too short)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   886
 		return 0xFFFFFFFF;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   887
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   888
 	
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   889
@@ -2441,7 +2441,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   890
 do_note_off (unsigned char ch, struct _mdi *mdi, unsigned long int ptr) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   891
 	struct _note *nte;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   892
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   893
-	MIDI_EVENT_DEBUG(__FUNCTION__,ch);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   894
+	MIDI_EVENT_DEBUG(__func__,ch);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   895
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   896
 	nte = &mdi->note_table[0][ch][mdi->data[ptr]];
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   897
 	if (!nte->active)
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   898
@@ -2530,7 +2530,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   899
 		return;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   900
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   901
 	
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   902
-	MIDI_EVENT_DEBUG(__FUNCTION__,ch);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   903
+	MIDI_EVENT_DEBUG(__func__,ch);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   904
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   905
 	if (ch != 9) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   906
 		patch = mdi->channel[ch].patch;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   907
@@ -2597,7 +2597,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   908
 do_aftertouch (unsigned char ch, struct _mdi *mdi, unsigned long int ptr) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   909
 	struct _note *nte;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   910
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   911
-	MIDI_EVENT_DEBUG(__FUNCTION__,ch);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   912
+	MIDI_EVENT_DEBUG(__func__,ch);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   913
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   914
 	nte = &mdi->note_table[0][ch][mdi->data[ptr]];
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   915
 	if (!nte->active) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   916
@@ -2945,7 +2945,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   917
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   918
 void
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   919
 do_patch (unsigned char ch, struct _mdi *mdi, unsigned long int ptr) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   920
-	MIDI_EVENT_DEBUG(__FUNCTION__,ch);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   921
+	MIDI_EVENT_DEBUG(__func__,ch);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   922
 	if (ch != 9) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   923
 		mdi->channel[ch].patch = get_patch_data(mdi, ((mdi->channel[ch].bank << 8) | mdi->data[ptr]));
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   924
 	} else {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   925
@@ -2956,7 +2956,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   926
 void
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   927
 do_channel_pressure (unsigned char ch, struct _mdi *mdi, unsigned long int ptr) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   928
 	struct _note **note_data = mdi->note;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   929
-	MIDI_EVENT_DEBUG(__FUNCTION__,ch);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   930
+	MIDI_EVENT_DEBUG(__func__,ch);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   931
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   932
 	if (note_data != mdi->last_note) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   933
 		do {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   934
@@ -2978,7 +2978,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   935
 do_pitch (unsigned char ch, struct _mdi *mdi, unsigned long int ptr) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   936
 	struct _note **note_data = mdi->note;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   937
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   938
-	MIDI_EVENT_DEBUG(__FUNCTION__,ch);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   939
+	MIDI_EVENT_DEBUG(__func__,ch);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   940
 	mdi->channel[ch].pitch = ((mdi->data[ptr+1] << 7) | mdi->data[ptr]) - 0x2000;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   941
 	
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   942
 	if (mdi->channel[ch].pitch < 0) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   943
@@ -3002,7 +3002,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   944
 	unsigned char event_type = 0xF0 | ch;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   945
 	static unsigned long int tempo = 500000;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   946
 	
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   947
-	MIDI_EVENT_DEBUG(__FUNCTION__,ch);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   948
+	MIDI_EVENT_DEBUG(__func__,ch);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   949
 	if (event_type == 0xFF) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   950
 		if ((mdi->data[ptr] == 0x51) && (mdi->data[ptr+1] == 3)) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   951
 			tempo = (mdi->data[ptr+2] << 16) | (mdi->data[ptr+3] << 8) | mdi->data[ptr+4];
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   952
@@ -3017,7 +3017,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   953
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   954
 void
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   955
 do_null (unsigned char ch, struct _mdi *mdi, unsigned long int ptr) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   956
-	MIDI_EVENT_DEBUG(__FUNCTION__,ch);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   957
+	MIDI_EVENT_DEBUG(__func__,ch);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   958
 };
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   959
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   960
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   961
@@ -3138,7 +3138,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   962
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   963
 void
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   964
 do_amp_setup_note_off (unsigned char ch, struct _mdi *mdi, struct _miditrack *track) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   965
-	MIDI_EVENT_DEBUG(__FUNCTION__,ch);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   966
+	MIDI_EVENT_DEBUG(__func__,ch);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   967
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   968
 	mdi->lin_cur_vol -=  (lin_volume[mdi->note_vel[ch][mdi->data[track->ptr]]] * 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   969
 		lin_volume[mdi->ch_exp[ch]] * lin_volume[mdi->ch_vol[ch]]) / 1048576;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   970
@@ -3154,7 +3154,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   971
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   972
 void
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   973
 do_amp_setup_note_on (unsigned char ch, struct _mdi *mdi, struct _miditrack *track) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   974
-	MIDI_EVENT_DEBUG(__FUNCTION__,ch);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   975
+	MIDI_EVENT_DEBUG(__func__,ch);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   976
 	if (mdi->data[track->ptr+1] == 0x00) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   977
 		do_amp_setup_note_off(ch, mdi, track);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   978
 		track->running_event = 0x90 | ch;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   979
@@ -3194,7 +3194,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   980
 do_amp_setup_aftertouch (unsigned char ch, struct _mdi *mdi, struct _miditrack *track) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   981
 	unsigned char pres = mdi->data[track->ptr+1];
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   982
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   983
-	MIDI_EVENT_DEBUG(__FUNCTION__,ch);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   984
+	MIDI_EVENT_DEBUG(__func__,ch);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   985
 	
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   986
 	if (pres == 0)
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   987
 		pres = 1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   988
@@ -3229,7 +3229,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   989
 do_amp_setup_control (unsigned char ch, struct _mdi *mdi, struct _miditrack *track) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   990
 	int i;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   991
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   992
-	MIDI_EVENT_DEBUG(__FUNCTION__,ch);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   993
+	MIDI_EVENT_DEBUG(__func__,ch);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   994
 	if (mdi->data[track->ptr] == 0x00) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   995
 		mdi->channel[ch].bank = mdi->data[track->ptr + 1];
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   996
 	} else if (mdi->data[track->ptr] == 0x07) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   997
@@ -3300,7 +3300,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   998
 	int i;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
   999
 	unsigned char pres = mdi->data[track->ptr];
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1000
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1001
-	MIDI_EVENT_DEBUG(__FUNCTION__,ch);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1002
+	MIDI_EVENT_DEBUG(__func__,ch);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1003
 	
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1004
 	if (pres == 0)
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1005
 		pres = 1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1006
@@ -3334,7 +3334,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1007
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1008
 void
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1009
 do_amp_setup_pitch (unsigned char ch, struct _mdi *mdi, struct _miditrack *track) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1010
-	MIDI_EVENT_DEBUG(__FUNCTION__,ch);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1011
+	MIDI_EVENT_DEBUG(__func__,ch);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1012
 	track->running_event = 0xE0 | ch;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1013
 	track->ptr += 2;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1014
 	return;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1015
@@ -3347,7 +3347,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1016
 	unsigned char event_data = mdi->data[track->ptr];
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1017
 	static unsigned long int tempo = 500000;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1018
 	
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1019
-	MIDI_EVENT_DEBUG(__FUNCTION__,ch);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1020
+	MIDI_EVENT_DEBUG(__func__,ch);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1021
 	if (event_type == 0xF0) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1022
 		track->running_event = 0x00;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1023
 		do {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1024
@@ -3407,7 +3407,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1025
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1026
 	mdi = malloc(sizeof(struct _mdi));
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1027
 	if (mdi == NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1028
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM," to parse midi data", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1029
+		WM_ERROR(__func__, __LINE__, WM_ERR_MEM," to parse midi data", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1030
 		free (mididata);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1031
 		return NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1032
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1033
@@ -3421,7 +3421,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1034
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1035
 	mdi->index = malloc(((midisize / 2) + 1)* sizeof(struct _mdi_index));
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1036
 	if (mdi->index == NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1037
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM," to parse midi data", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1038
+		WM_ERROR(__func__, __LINE__, WM_ERR_MEM," to parse midi data", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1039
 		free(mdi);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1040
 		return NULL;		
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1041
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1042
@@ -3444,14 +3444,14 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1043
 		midiofs = 20;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1044
 						
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1045
 	if (strncmp(&mididata[midiofs],"MThd",4) != 0) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1046
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID,"(not a midi file)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1047
+		WM_ERROR(__func__, __LINE__, WM_ERR_INVALID,"(not a midi file)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1048
 		free(mdi->index);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1049
 		free(mdi);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1050
 		return NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1051
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1052
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1053
 	if ((midiofs + 25) > midisize) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1054
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_CORUPT,"(too short)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1055
+		WM_ERROR(__func__, __LINE__, WM_ERR_CORUPT,"(too short)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1056
 		free(mdi->index);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1057
 		free(mdi);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1058
 		return NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1059
@@ -3459,7 +3459,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1060
 	
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1061
 	midiofs += 9;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1062
 	if (mididata[midiofs] > 1) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1063
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, NULL, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1064
+		WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, NULL, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1065
 		free(mdi->index);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1066
 		free(mdi);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1067
 		return NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1068
@@ -3478,7 +3478,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1069
 	if (first_handle == NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1070
 		first_handle = malloc(sizeof(struct _hndl));
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1071
 		if (first_handle == NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1072
-			WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM," to parse midi data", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1073
+			WM_ERROR(__func__, __LINE__, WM_ERR_MEM," to parse midi data", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1074
 			free(mdi->data);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1075
 			free(mdi);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1076
 			return NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1077
@@ -3495,7 +3495,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1078
 		}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1079
 		tmp_handle->next = malloc(sizeof(struct _hndl));
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1080
 		if (tmp_handle->next == NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1081
-			WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM," to parse midi data", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1082
+			WM_ERROR(__func__, __LINE__, WM_ERR_MEM," to parse midi data", errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1083
 			free(mdi->data);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1084
 			free(mdi);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1085
 			return NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1086
@@ -3512,13 +3512,13 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1087
 	midi_track_counter = 0;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1088
 	while (midi_track_counter != no_tracks) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1089
 		if ((midiofs + 12) > midisize) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1090
-			WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_CORUPT, "(too short)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1091
+			WM_ERROR(__func__, __LINE__, WM_ERR_CORUPT, "(too short)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1092
 			WildMidi_Close(mdi);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1093
 			free(tmp_trackdata);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1094
 			return NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1095
 		}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1096
 		if (strncmp(&mididata[midiofs],"MTrk",4) != 0) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1097
-			WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_CORUPT, "(Expected track header)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1098
+			WM_ERROR(__func__, __LINE__, WM_ERR_CORUPT, "(Expected track header)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1099
 			WildMidi_Close(mdi);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1100
 			free(tmp_trackdata);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1101
 			return NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1102
@@ -3528,7 +3528,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1103
 		midiofs += 4;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1104
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1105
 		if (midisize < (midiofs + tmp_trackdata[midi_track_counter].length)) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1106
-			WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_CORUPT, "(too short)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1107
+			WM_ERROR(__func__, __LINE__, WM_ERR_CORUPT, "(too short)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1108
 			WildMidi_Close(mdi);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1109
 			free(tmp_trackdata);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1110
 			return NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1111
@@ -3545,7 +3545,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1112
 		midiofs += tmp_trackdata[midi_track_counter].length;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1113
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1114
 		if (memcmp(&mididata[midiofs-3], eot,3) != 0) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1115
-			WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_CORUPT, "(Expected EOT)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1116
+			WM_ERROR(__func__, __LINE__, WM_ERR_CORUPT, "(Expected EOT)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1117
 			WildMidi_Close(mdi);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1118
 			free(tmp_trackdata);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1119
 			return NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1120
@@ -3579,7 +3579,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1121
 				if (mdi->data[tmp_trackdata[i].ptr] < 0x80) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1122
 					current_event = tmp_trackdata[i].running_event;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1123
 					if (current_event < 0x80) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1124
-						WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_CORUPT, "(expected event)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1125
+						WM_ERROR(__func__, __LINE__, WM_ERR_CORUPT, "(expected event)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1126
 						WildMidi_Close(mdi);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1127
 						free(tmp_trackdata);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1128
 						return NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1129
@@ -3630,7 +3630,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1130
 	mdi->index_size = index_count;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1131
 	mdi->index = realloc(mdi->index, (sizeof(struct _mdi_index) * mdi->index_size));
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1132
 	if (mdi->index == NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1133
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, NULL, errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1134
+		WM_ERROR(__func__, __LINE__, WM_ERR_MEM, NULL, errno);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1135
 		WildMidi_Close(mdi);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1136
 		free(tmp_trackdata);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1137
 		return NULL;		
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1138
@@ -3704,12 +3704,12 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1139
 int 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1140
 WildMidi_Init (const char * config_file, unsigned short int rate, unsigned short int options) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1141
 	if (WM_Initialized) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1142
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1143
+		WM_ERROR(__func__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1144
 		return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1145
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1146
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1147
 	if (config_file == NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1148
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(NULL config file pointer)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1149
+		WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(NULL config file pointer)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1150
 		return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1151
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1152
 	WM_InitPatches();
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1153
@@ -3718,14 +3718,14 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1154
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1155
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1156
 	if (options & 0xFFD8) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1157
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(invalid option)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1158
+		WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(invalid option)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1159
 		WM_FreePatches();
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1160
 		return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1161
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1162
 	WM_MixerOptions = options;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1163
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1164
 	if ((rate < 11000) || (rate > 65000)) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1165
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(rate out of bounds, range is 11000 - 65000)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1166
+		WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(rate out of bounds, range is 11000 - 65000)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1167
 		WM_FreePatches();
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1168
 		return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1169
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1170
@@ -3745,11 +3745,11 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1171
 	int i = 0;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1172
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1173
 	if (!WM_Initialized) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1174
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1175
+		WM_ERROR(__func__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1176
 		return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1177
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1178
 	if (master_volume > 127) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1179
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(master volume out of range, range is 0-127)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1180
+		WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(master volume out of range, range is 0-127)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1181
 		return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1182
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1183
 	
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1184
@@ -3776,15 +3776,15 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1185
 	int i;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1186
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1187
 	if (!WM_Initialized) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1188
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1189
+		WM_ERROR(__func__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1190
 		return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1191
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1192
 	if (handle == NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1193
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(NULL handle)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1194
+		WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(NULL handle)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1195
 		return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1196
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1197
 	if (first_handle == NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1198
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(no midi's open)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1199
+		WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(no midi's open)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1200
 		return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1201
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1202
 	WM_Lock(&mdi->lock);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1203
@@ -3799,7 +3799,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1204
 		while (tmp_handle->handle != handle) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1205
 			tmp_handle = tmp_handle->next;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1206
 			if (tmp_handle == NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1207
-				WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(handle does not exist)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1208
+				WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(handle does not exist)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1209
 				return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1210
 			}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1211
 		}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1212
@@ -3850,11 +3850,11 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1213
 	unsigned long int midisize = 0;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1214
 	
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1215
 	if (!WM_Initialized) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1216
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1217
+		WM_ERROR(__func__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1218
 		return NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1219
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1220
 	if (midifile == NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1221
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(NULL filename)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1222
+		WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(NULL filename)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1223
 		return NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1224
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1225
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1226
@@ -3868,11 +3868,11 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1227
 midi *
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1228
 WildMidi_OpenBuffer (unsigned char *midibuffer, unsigned long int size) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1229
 	if (!WM_Initialized) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1230
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1231
+		WM_ERROR(__func__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1232
 		return NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1233
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1234
 	if (midibuffer == NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1235
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(NULL midi data buffer)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1236
+		WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(NULL midi data buffer)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1237
 		return NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1238
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1239
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1240
@@ -3901,16 +3901,16 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1241
 	unsigned long int real_samples_to_mix = 0;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1242
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1243
 	if (!WM_Initialized) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1244
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1245
+		WM_ERROR(__func__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1246
 		return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1247
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1248
 	if (handle == NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1249
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(NULL handle)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1250
+		WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(NULL handle)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1251
 		return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1252
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1253
 	WM_Lock(&mdi->lock);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1254
 	if (sample_pos == NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1255
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(NULL seek position pointer)", 0);		
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1256
+		WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(NULL seek position pointer)", 0);		
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1257
 		WM_Unlock(&mdi->lock);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1258
 		return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1259
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1260
@@ -3992,16 +3992,16 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1261
 	unsigned long int tmp_samples_to_mix = 0;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1262
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1263
 	if (!WM_Initialized) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1264
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1265
+		WM_ERROR(__func__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1266
 		return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1267
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1268
 	if (handle == NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1269
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(NULL handle)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1270
+		WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(NULL handle)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1271
 		return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1272
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1273
 	WM_Lock(&mdi->lock);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1274
 	if (sample_pos == NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1275
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(NULL seek position pointer)", 0);		
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1276
+		WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(NULL seek position pointer)", 0);		
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1277
 		WM_Unlock(&mdi->lock);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1278
 		return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1279
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1280
@@ -4191,15 +4191,15 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1281
 	unsigned long int count;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1282
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1283
 	if (__builtin_expect((!WM_Initialized),0)) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1284
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1285
+		WM_ERROR(__func__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1286
 		return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1287
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1288
 	if (__builtin_expect((handle == NULL),0)) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1289
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(NULL handle)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1290
+		WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(NULL handle)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1291
 		return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1292
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1293
 	if (__builtin_expect((buffer == NULL),0)) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1294
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(NULL buffer pointer)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1295
+		WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(NULL buffer pointer)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1296
 		return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1297
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1298
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1299
@@ -4208,7 +4208,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1300
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1301
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1302
 	if (__builtin_expect((size % 4),0)) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1303
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(size not a multiple of 4)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1304
+		WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(size not a multiple of 4)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1305
 		return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1306
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1307
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1308
@@ -4548,15 +4548,15 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1309
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1310
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1311
 	if (__builtin_expect((!WM_Initialized),0)) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1312
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1313
+		WM_ERROR(__func__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1314
 		return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1315
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1316
 	if (__builtin_expect((handle == NULL),0)) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1317
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(NULL handle)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1318
+		WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(NULL handle)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1319
 		return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1320
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1321
 	if (__builtin_expect((buffer == NULL),0)) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1322
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(NULL buffer pointer)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1323
+		WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(NULL buffer pointer)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1324
 		return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1325
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1326
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1327
@@ -4565,7 +4565,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1328
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1329
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1330
 	if (__builtin_expect((size % 4),0)) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1331
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(size not a multiple of 4)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1332
+		WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(size not a multiple of 4)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1333
 		return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1334
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1335
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1336
@@ -4922,15 +4922,15 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1337
 	struct _mdi *mdi = (struct _mdi *)handle;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1338
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1339
 	if (__builtin_expect((!WM_Initialized),0)) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1340
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1341
+		WM_ERROR(__func__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1342
 		return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1343
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1344
 	if (__builtin_expect((handle == NULL),0)) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1345
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(NULL handle)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1346
+		WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(NULL handle)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1347
 		return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1348
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1349
 	if (__builtin_expect((buffer == NULL),0)) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1350
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(NULL buffer pointer)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1351
+		WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(NULL buffer pointer)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1352
 		return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1353
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1354
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1355
@@ -4939,7 +4939,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1356
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1357
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1358
 	if (__builtin_expect((size % 4),0)) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1359
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(size not a multiple of 4)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1360
+		WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(size not a multiple of 4)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1361
 		return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1362
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1363
 	if (mdi->info.mixer_options & WM_MO_EXPENSIVE_INTERPOLATION) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1364
@@ -4956,21 +4956,21 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1365
 	int i;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1366
 	
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1367
 	if (!WM_Initialized) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1368
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1369
+		WM_ERROR(__func__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1370
 		return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1371
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1372
 	if (handle == NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1373
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(NULL handle)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1374
+		WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(NULL handle)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1375
 		return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1376
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1377
 	WM_Lock(&mdi->lock);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1378
 	if ((!(options & 0x0007)) || (options & 0xFFF8)){
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1379
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(invalid option)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1380
+		WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(invalid option)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1381
 		WM_Unlock(&mdi->lock);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1382
 		return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1383
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1384
 	if (setting & 0xFFF8) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1385
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(invalid setting)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1386
+		WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(invalid setting)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1387
 		WM_Unlock(&mdi->lock);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1388
 		return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1389
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1390
@@ -5023,18 +5023,18 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1391
 WildMidi_GetInfo (midi * handle) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1392
 	struct _mdi *mdi = (struct _mdi *)handle;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1393
 	if (!WM_Initialized) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1394
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1395
+		WM_ERROR(__func__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1396
 		return NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1397
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1398
 	if (handle == NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1399
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(NULL handle)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1400
+		WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(NULL handle)", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1401
 		return NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1402
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1403
 	WM_Lock(&mdi->lock);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1404
 	if (mdi->tmp_info == NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1405
 		mdi->tmp_info = malloc(sizeof(struct _WM_Info));
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1406
 		if (mdi->tmp_info == NULL) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1407
-			WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to set info", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1408
+			WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to set info", 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1409
 			WM_Unlock(&mdi->lock);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1410
 			return NULL;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1411
 		}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1412
@@ -5051,7 +5051,7 @@
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1413
 	struct _hndl * tmp_hdle;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1414
 
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1415
 	if (!WM_Initialized) {
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1416
-		WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1417
+		WM_ERROR(__func__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1418
 		return -1;
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1419
 	}
48fdf7d99a3b 2009-06-13 Milan Jurik <[email protected]>
jurikm
parents:
diff changeset
  1420
 	if (first_handle != NULL) {