summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--StdLib/LibC/Uefi/Devices/Console/daConsole.c3
-rw-r--r--StdLib/LibC/Uefi/Devices/UefiShell/daShell.c3
-rw-r--r--StdLib/LibC/Uefi/Devices/Utility/DevGenisis.c3
-rw-r--r--StdLib/PosixLib/Stringlist/stringlist.c119
-rw-r--r--StdLib/StdLib.dsc6
-rw-r--r--StdLibPrivateInternalFiles/Include/kfile.h5
6 files changed, 72 insertions, 67 deletions
diff --git a/StdLib/LibC/Uefi/Devices/Console/daConsole.c b/StdLib/LibC/Uefi/Devices/Console/daConsole.c
index 5a593557e0..600fb073c4 100644
--- a/StdLib/LibC/Uefi/Devices/Console/daConsole.c
+++ b/StdLib/LibC/Uefi/Devices/Console/daConsole.c
@@ -26,6 +26,7 @@
#include <errno.h>
#include <wctype.h>
#include <wchar.h>
+#include <stdarg.h>
#include <sys/fcntl.h>
#include <kfile.h>
#include <Device/Device.h>
@@ -377,7 +378,7 @@ EFIAPI
da_ConIoctl(
struct __filedes *filp,
ULONGN cmd,
- void *argp
+ va_list argp
)
{
return -EPERM;
diff --git a/StdLib/LibC/Uefi/Devices/UefiShell/daShell.c b/StdLib/LibC/Uefi/Devices/UefiShell/daShell.c
index d56db49159..d0abb8dd5b 100644
--- a/StdLib/LibC/Uefi/Devices/UefiShell/daShell.c
+++ b/StdLib/LibC/Uefi/Devices/UefiShell/daShell.c
@@ -26,6 +26,7 @@
#include <errno.h>
#include <string.h>
#include <stdlib.h>
+#include <stdarg.h>
#include <wctype.h>
#include <wchar.h>
#include <sys/fcntl.h>
@@ -319,7 +320,7 @@ EFIAPI
da_ShellIoctl(
struct __filedes *filp,
ULONGN cmd,
- void *argp ///< May be a pointer or a value
+ va_list argp
)
{
return -EPERM;
diff --git a/StdLib/LibC/Uefi/Devices/Utility/DevGenisis.c b/StdLib/LibC/Uefi/Devices/Utility/DevGenisis.c
index 6510ce7747..f6d375e6db 100644
--- a/StdLib/LibC/Uefi/Devices/Utility/DevGenisis.c
+++ b/StdLib/LibC/Uefi/Devices/Utility/DevGenisis.c
@@ -17,6 +17,7 @@
#include <LibConfig.h>
#include <errno.h>
+#include <stdarg.h>
#include <sys/poll.h>
#include <kfile.h>
#include <Device/Device.h>
@@ -45,7 +46,7 @@ int EFIAPI fnullop_flush (struct __filedes *filp)
int EFIAPI fbadop_stat (struct __filedes *filp, struct stat *StatBuf, void *Buf)
{ return -EPERM; }
-int EFIAPI fbadop_ioctl (struct __filedes *filp, ULONGN Cmd, void *argp)
+int EFIAPI fbadop_ioctl (struct __filedes *filp, ULONGN Cmd, va_list argp)
{ return -EPERM; }
int EFIAPI fbadop_delete (struct __filedes *filp)
diff --git a/StdLib/PosixLib/Stringlist/stringlist.c b/StdLib/PosixLib/Stringlist/stringlist.c
index 47e3bee748..0629f90e87 100644
--- a/StdLib/PosixLib/Stringlist/stringlist.c
+++ b/StdLib/PosixLib/Stringlist/stringlist.c
@@ -1,4 +1,4 @@
-/* $NetBSD: stringlist.c,v 1.13 2008/04/28 20:22:59 martin Exp $
+/* $NetBSD: stringlist.c,v 1.13 2008/04/28 20:22:59 martin Exp $
* Copyright (c) 1994, 1999 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -27,8 +27,9 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
-
-#pragma warning ( disable : 4018 )
+#if defined(_MSC_VER) /* Handle Microsoft VC++ compiler specifics. */
+ #pragma warning ( disable : 4018 )
+#endif
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
@@ -49,7 +50,7 @@ __weak_alias(sl_init,_sl_init)
__weak_alias(sl_delete,_sl_delete)
#endif
-#define _SL_CHUNKSIZE 20
+#define _SL_CHUNKSIZE 20
/*
* sl_init(): Initialize a string list
@@ -57,20 +58,20 @@ __weak_alias(sl_delete,_sl_delete)
StringList *
sl_init(void)
{
- StringList *sl;
-
- sl = malloc(sizeof(StringList));
- if (sl == NULL)
- return NULL;
-
- sl->sl_cur = 0;
- sl->sl_max = _SL_CHUNKSIZE;
- sl->sl_str = malloc(sl->sl_max * sizeof(char *));
- if (sl->sl_str == NULL) {
- free(sl);
- sl = NULL;
- }
- return sl;
+ StringList *sl;
+
+ sl = malloc(sizeof(StringList));
+ if (sl == NULL)
+ return NULL;
+
+ sl->sl_cur = 0;
+ sl->sl_max = _SL_CHUNKSIZE;
+ sl->sl_str = malloc(sl->sl_max * sizeof(char *));
+ if (sl->sl_str == NULL) {
+ free(sl);
+ sl = NULL;
+ }
+ return sl;
}
@@ -81,20 +82,20 @@ int
sl_add(StringList *sl, char *name)
{
- _DIAGASSERT(sl != NULL);
+ _DIAGASSERT(sl != NULL);
- if (sl->sl_cur == sl->sl_max - 1) {
- char **new;
+ if (sl->sl_cur == sl->sl_max - 1) {
+ char **new;
- new = realloc(sl->sl_str,
- (sl->sl_max + _SL_CHUNKSIZE) * sizeof(char *));
- if (new == NULL)
- return -1;
- sl->sl_max += _SL_CHUNKSIZE;
- sl->sl_str = new;
- }
- sl->sl_str[sl->sl_cur++] = name;
- return 0;
+ new = realloc(sl->sl_str,
+ (sl->sl_max + _SL_CHUNKSIZE) * sizeof(char *));
+ if (new == NULL)
+ return -1;
+ sl->sl_max += _SL_CHUNKSIZE;
+ sl->sl_str = new;
+ }
+ sl->sl_str[sl->sl_cur++] = name;
+ return 0;
}
@@ -104,17 +105,17 @@ sl_add(StringList *sl, char *name)
void
sl_free(StringList *sl, int all)
{
- size_t i;
-
- if (sl == NULL)
- return;
- if (sl->sl_str) {
- if (all)
- for (i = 0; i < sl->sl_cur; i++)
- free(sl->sl_str[i]);
- free(sl->sl_str);
- }
- free(sl);
+ size_t i;
+
+ if (sl == NULL)
+ return;
+ if (sl->sl_str) {
+ if (all)
+ for (i = 0; i < sl->sl_cur; i++)
+ free(sl->sl_str[i]);
+ free(sl->sl_str);
+ }
+ free(sl);
}
@@ -124,31 +125,31 @@ sl_free(StringList *sl, int all)
char *
sl_find(StringList *sl, const char *name)
{
- size_t i;
+ size_t i;
- _DIAGASSERT(sl != NULL);
+ _DIAGASSERT(sl != NULL);
- for (i = 0; i < sl->sl_cur; i++)
- if (strcmp(sl->sl_str[i], name) == 0)
- return sl->sl_str[i];
+ for (i = 0; i < sl->sl_cur; i++)
+ if (strcmp(sl->sl_str[i], name) == 0)
+ return sl->sl_str[i];
- return NULL;
+ return NULL;
}
int
sl_delete(StringList *sl, const char *name, int all)
{
- size_t i, j;
-
- for (i = 0; i < sl->sl_cur; i++)
- if (strcmp(sl->sl_str[i], name) == 0) {
- if (all)
- free(sl->sl_str[i]);
- for (j = i + 1; j < sl->sl_cur; j++)
- sl->sl_str[j - 1] = sl->sl_str[j];
- sl->sl_str[--sl->sl_cur] = NULL;
- return 0;
- }
- return -1;
+ size_t i, j;
+
+ for (i = 0; i < sl->sl_cur; i++)
+ if (strcmp(sl->sl_str[i], name) == 0) {
+ if (all)
+ free(sl->sl_str[i]);
+ for (j = i + 1; j < sl->sl_cur; j++)
+ sl->sl_str[j - 1] = sl->sl_str[j];
+ sl->sl_str[--sl->sl_cur] = NULL;
+ return 0;
+ }
+ return -1;
}
diff --git a/StdLib/StdLib.dsc b/StdLib/StdLib.dsc
index c352b22455..d01a2d6cb9 100644
--- a/StdLib/StdLib.dsc
+++ b/StdLib/StdLib.dsc
@@ -120,9 +120,9 @@
StdLib/PosixLib/Stringlist/LibStringlist.inf
# Socket Libraries - LibC based
- StdLib/BsdSocketLib/BsdSocketLib.inf
- StdLib/EfiSocketLib/EfiSocketLib.inf
- StdLib/UseSocketDxe/UseSocketDxe.inf
+# StdLib/BsdSocketLib/BsdSocketLib.inf
+# StdLib/EfiSocketLib/EfiSocketLib.inf
+# StdLib/UseSocketDxe/UseSocketDxe.inf
##############################################################################
#
diff --git a/StdLibPrivateInternalFiles/Include/kfile.h b/StdLibPrivateInternalFiles/Include/kfile.h
index c83b07b1a8..6e7d1b4c79 100644
--- a/StdLibPrivateInternalFiles/Include/kfile.h
+++ b/StdLibPrivateInternalFiles/Include/kfile.h
@@ -48,6 +48,7 @@
#include <Protocol/SimpleFileSystem.h>
#include <wchar.h>
+#include <stdarg.h>
#include <sys/fcntl.h>
#include <sys/unistd.h>
@@ -104,7 +105,7 @@ struct fileops {
/* Call the fbadop_* version of these functions if not implemented by the device. */
int (EFIAPI *fo_stat) (struct __filedes *filp, struct stat *StatBuf, void *Buf);
- int (EFIAPI *fo_ioctl) (struct __filedes *filp, ULONGN Cmd, void *argp);
+ int (EFIAPI *fo_ioctl) (struct __filedes *filp, ULONGN Cmd, va_list argp);
int (EFIAPI *fo_delete) (struct __filedes *filp);
int (EFIAPI *fo_rmdir) (struct __filedes *filp);
int (EFIAPI *fo_mkdir) (const char *path, __mode_t perms);
@@ -159,7 +160,7 @@ short EFIAPI fnullop_poll (struct __filedes *filp, short Events);
int EFIAPI fnullop_flush (struct __filedes *filp);
int EFIAPI fbadop_stat (struct __filedes *filp, struct stat *StatBuf, void *Buf);
-int EFIAPI fbadop_ioctl (struct __filedes *filp, ULONGN Cmd, void *argp);
+int EFIAPI fbadop_ioctl (struct __filedes *filp, ULONGN Cmd, va_list argp);
int EFIAPI fbadop_delete (struct __filedes *filp);
int EFIAPI fbadop_rmdir (struct __filedes *filp);
int EFIAPI fbadop_mkdir (const char *path, __mode_t perms);