diff options
author | Adam Jackson <ajax@redhat.com> | 2009-04-06 17:51:35 -0400 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2009-04-06 17:51:35 -0400 |
commit | 485946120a6522db9298111752de9be3d675e0b3 (patch) | |
tree | f61ba00eca93778087c1e829dd6b924cdf487e66 | |
parent | 5f769b73441cf29c05a05c728ab81bdde1fc00b6 (diff) |
config: s/xf86configStrdup/strdup/
-rw-r--r-- | hw/xfree86/parser/Device.c | 11 | ||||
-rw-r--r-- | hw/xfree86/parser/Flags.c | 9 | ||||
-rw-r--r-- | hw/xfree86/parser/Pointer.c | 34 | ||||
-rw-r--r-- | hw/xfree86/parser/Screen.c | 2 | ||||
-rw-r--r-- | hw/xfree86/parser/scan.c | 2 | ||||
-rw-r--r-- | hw/xfree86/parser/xf86Optrec.h | 2 |
6 files changed, 24 insertions, 36 deletions
diff --git a/hw/xfree86/parser/Device.c b/hw/xfree86/parser/Device.c index 216789fc1..d1621c92c 100644 --- a/hw/xfree86/parser/Device.c +++ b/hw/xfree86/parser/Device.c @@ -369,14 +369,3 @@ xf86findDevice (const char *ident, XF86ConfDevicePtr p) } return (NULL); } - -char * -xf86configStrdup (const char *s) -{ - char *tmp; - if (!s) return NULL; - tmp = xf86confmalloc (sizeof (char) * (strlen (s) + 1)); - if (tmp) - strcpy (tmp, s); - return (tmp); -} diff --git a/hw/xfree86/parser/Flags.c b/hw/xfree86/parser/Flags.c index 8f44ea5ec..0a9724c60 100644 --- a/hw/xfree86/parser/Flags.c +++ b/hw/xfree86/parser/Flags.c @@ -1,5 +1,4 @@ /* - * * Copyright (c) 1997 Metro Link Incorporated * * Permission is hereby granted, free of charge, to any person obtaining a @@ -134,7 +133,7 @@ xf86parseFlagsSection (void) { char *valstr = NULL; /* can't use strdup because it calls malloc */ - tmp = xf86configStrdup (ServerFlagsTab[i].name); + tmp = strdup (ServerFlagsTab[i].name); if (hasvalue) { tokentype = xf86getSubToken(&(ptr->flg_comment)); @@ -239,11 +238,11 @@ xf86optionListDup (XF86OptionPtr opt) while (opt) { - newopt = xf86addNewOption(newopt, xf86configStrdup(opt->opt_name), - xf86configStrdup(opt->opt_val)); + newopt = xf86addNewOption(newopt, strdup(opt->opt_name), + strdup(opt->opt_val)); newopt->opt_used = opt->opt_used; if (opt->opt_comment) - newopt->opt_comment = xf86configStrdup(opt->opt_comment); + newopt->opt_comment = strdup(opt->opt_comment); opt = opt->list.next; } return newopt; diff --git a/hw/xfree86/parser/Pointer.c b/hw/xfree86/parser/Pointer.c index eeb0834bf..30ad8df84 100644 --- a/hw/xfree86/parser/Pointer.c +++ b/hw/xfree86/parser/Pointer.c @@ -115,19 +115,19 @@ xf86parsePointerSection (void) if (xf86getSubToken (&(ptr->inp_comment)) != STRING) Error (QUOTE_MSG, "Protocol"); ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst, - xf86configStrdup("Protocol"), + strdup("Protocol"), val.str); break; case PDEVICE: if (xf86getSubToken (&(ptr->inp_comment)) != STRING) Error (QUOTE_MSG, "Device"); ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst, - xf86configStrdup("Device"), + strdup("Device"), val.str); break; case EMULATE3: ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst, - xf86configStrdup("Emulate3Buttons"), + strdup("Emulate3Buttons"), NULL); break; case EM3TIMEOUT: @@ -135,12 +135,12 @@ xf86parsePointerSection (void) Error (POSITIVE_INT_MSG, "Emulate3Timeout"); s = xf86uLongToString(val.num); ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst, - xf86configStrdup("Emulate3Timeout"), + strdup("Emulate3Timeout"), s); break; case CHORDMIDDLE: ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst, - xf86configStrdup("ChordMiddle"), + strdup("ChordMiddle"), NULL); break; case PBUTTONS: @@ -148,36 +148,36 @@ xf86parsePointerSection (void) Error (POSITIVE_INT_MSG, "Buttons"); s = xf86uLongToString(val.num); ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst, - xf86configStrdup("Buttons"), s); + strdup("Buttons"), s); break; case BAUDRATE: if (xf86getSubToken (&(ptr->inp_comment)) != NUMBER || val.num < 0) Error (POSITIVE_INT_MSG, "BaudRate"); s = xf86uLongToString(val.num); ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst, - xf86configStrdup("BaudRate"), s); + strdup("BaudRate"), s); break; case SAMPLERATE: if (xf86getSubToken (&(ptr->inp_comment)) != NUMBER || val.num < 0) Error (POSITIVE_INT_MSG, "SampleRate"); s = xf86uLongToString(val.num); ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst, - xf86configStrdup("SampleRate"), s); + strdup("SampleRate"), s); break; case PRESOLUTION: if (xf86getSubToken (&(ptr->inp_comment)) != NUMBER || val.num < 0) Error (POSITIVE_INT_MSG, "Resolution"); s = xf86uLongToString(val.num); ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst, - xf86configStrdup("Resolution"), s); + strdup("Resolution"), s); break; case CLEARDTR: ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst, - xf86configStrdup("ClearDTR"), NULL); + strdup("ClearDTR"), NULL); break; case CLEARRTS: ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst, - xf86configStrdup("ClearRTS"), NULL); + strdup("ClearRTS"), NULL); break; case ZAXISMAPPING: switch (xf86getToken(ZMapTab)) { @@ -197,17 +197,17 @@ xf86parsePointerSection (void) xf86conffree(s2); break; case XAXIS: - s = xf86configStrdup("x"); + s = strdup("x"); break; case YAXIS: - s = xf86configStrdup("y"); + s = strdup("y"); break; default: Error (ZAXISMAPPING_MSG, NULL); break; } ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst, - xf86configStrdup("ZAxisMapping"), + strdup("ZAxisMapping"), s); break; case ALWAYSCORE: @@ -221,10 +221,10 @@ xf86parsePointerSection (void) } } - ptr->inp_identifier = xf86configStrdup(CONF_IMPLICIT_POINTER); - ptr->inp_driver = xf86configStrdup("mouse"); + ptr->inp_identifier = strdup(CONF_IMPLICIT_POINTER); + ptr->inp_driver = strdup("mouse"); ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst, - xf86configStrdup("CorePointer"), NULL); + strdup("CorePointer"), NULL); #ifdef DEBUG printf ("Pointer section parsed\n"); diff --git a/hw/xfree86/parser/Screen.c b/hw/xfree86/parser/Screen.c index dfc02bb72..1afbf8f97 100644 --- a/hw/xfree86/parser/Screen.c +++ b/hw/xfree86/parser/Screen.c @@ -544,7 +544,7 @@ xf86validateScreen (XF86ConfigPtr p) return (FALSE); } - adaptor->al_adaptor->va_fwdref = xf86configStrdup(screen->scrn_identifier); + adaptor->al_adaptor->va_fwdref = strdup(screen->scrn_identifier); adaptor = adaptor->list.next; } diff --git a/hw/xfree86/parser/scan.c b/hw/xfree86/parser/scan.c index 7a9bb9305..ecca9e68d 100644 --- a/hw/xfree86/parser/scan.c +++ b/hw/xfree86/parser/scan.c @@ -877,7 +877,7 @@ void xf86setBuiltinConfig(const char *config[]) { builtinConfig = config; - configPath = xf86configStrdup("<builtin configuration>"); + configPath = strdup("<builtin configuration>"); configBuf = xf86confmalloc (CONFIG_BUF_LEN); configRBuf = xf86confmalloc (CONFIG_BUF_LEN); configBuf[0] = '\0'; /* sanity ... */ diff --git a/hw/xfree86/parser/xf86Optrec.h b/hw/xfree86/parser/xf86Optrec.h index 77b316a60..5ccf7285b 100644 --- a/hw/xfree86/parser/xf86Optrec.h +++ b/hw/xfree86/parser/xf86Optrec.h @@ -64,6 +64,7 @@ #ifndef _xf86Optrec_h_ #define _xf86Optrec_h_ #include <stdio.h> +#include <string.h> #include <X11/Xfuncproto.h> @@ -102,7 +103,6 @@ extern _X_EXPORT XF86OptionPtr xf86findOption(XF86OptionPtr list, const char *na extern _X_EXPORT char *xf86findOptionValue(XF86OptionPtr list, const char *name); extern _X_EXPORT XF86OptionPtr xf86optionListCreate(const char **options, int count, int used); extern _X_EXPORT XF86OptionPtr xf86optionListMerge(XF86OptionPtr head, XF86OptionPtr tail); -extern _X_EXPORT char *xf86configStrdup (const char *s); extern _X_EXPORT int xf86nameCompare (const char *s1, const char *s2); extern _X_EXPORT char *xf86uLongToString(unsigned long i); extern _X_EXPORT XF86OptionPtr xf86parseOption(XF86OptionPtr head); |