Don't use // as comments, it breaks some C compilers

Also, really remove the dead code.
This commit is contained in:
Marcelo Roberto Jimenez 2012-03-16 11:51:10 -03:00
parent cb07623dde
commit e0444b26e6
7 changed files with 20 additions and 48 deletions

View File

@ -2148,8 +2148,6 @@ static int isTopLevelElement(
static BOOL Parser_hasDefaultNamespace( static BOOL Parser_hasDefaultNamespace(
/*! [in] The XML parser. */ /*! [in] The XML parser. */
Parser *xmlParser, Parser *xmlParser,
/*! [in] The Node to process. */
/*IXML_Node *newNode,*/
/*! [in,out] The name space URI. */ /*! [in,out] The name space URI. */
char **nsURI ) char **nsURI )
{ {
@ -2165,7 +2163,6 @@ static BOOL Parser_hasDefaultNamespace(
} }
return FALSE; return FALSE;
//newNode = newNode;
} }
@ -2218,7 +2215,7 @@ static int Parser_processElementName(
} else { } else {
/* does element has default namespace */ /* does element has default namespace */
/* the node may have default namespace definition */ /* the node may have default namespace definition */
if (Parser_hasDefaultNamespace(xmlParser, /*newNode,*/ &nsURI)) { if (Parser_hasDefaultNamespace(xmlParser, &nsURI)) {
Parser_setElementNamespace(newElement, nsURI); Parser_setElementNamespace(newElement, nsURI);
} else { } else {
switch (xmlParser->state) { switch (xmlParser->state) {

View File

@ -766,42 +766,32 @@ static IXML_Element *ixmlNode_cloneElement(
/*! /*!
* \brief Returns a clone of a document node. * \brief Returns a new document node.
* *
* Currently, the IXML_Document struct is just a node, so this function * Currently, the IXML_Document struct is just a node, so this function
* just mallocs the IXML_Document, sets the node type and name. Curiously, * just mallocs the IXML_Document, sets the node type and name.
* the parameter nodeptr is not actually used.
* *
* \return A clone of a document node. * \return A new document node.
*/ */
static IXML_Document *ixmlNode_cloneDoc( static IXML_Document *ixmlNode_newDoc(void)
/*! [in] The \b Node to clone. */
/*IXML_Document *nodeptr*/)
{ {
IXML_Document *newDoc; IXML_Document *newDoc;
IXML_Node *docNode; IXML_Node *docNode;
int rc; int rc;
//assert(nodeptr != NULL);
newDoc = (IXML_Document *)malloc(sizeof (IXML_Document)); newDoc = (IXML_Document *)malloc(sizeof (IXML_Document));
if (newDoc == NULL) { if (!newDoc)
return NULL; return NULL;
}
ixmlDocument_init(newDoc); ixmlDocument_init(newDoc);
docNode = (IXML_Node *)newDoc; docNode = (IXML_Node *)newDoc;
rc = ixmlNode_setNodeName(docNode, DOCUMENTNODENAME); rc = ixmlNode_setNodeName(docNode, DOCUMENTNODENAME);
if (rc != IXML_SUCCESS) { if (rc != IXML_SUCCESS) {
ixmlDocument_free(newDoc); ixmlDocument_free(newDoc);
return NULL; return NULL;
} }
newDoc->n.nodeType = eDOCUMENT_NODE; newDoc->n.nodeType = eDOCUMENT_NODE;
return newDoc; return newDoc;
//nodeptr = nodeptr;
} }
/*! /*!
@ -968,7 +958,7 @@ static IXML_Node *ixmlNode_cloneNodeTreeRecursive(
break; break;
case eDOCUMENT_NODE: case eDOCUMENT_NODE:
newDoc = ixmlNode_cloneDoc(/*(IXML_Document *)nodeptr*/); newDoc = ixmlNode_newDoc();
if (newDoc == NULL) if (newDoc == NULL)
return NULL; return NULL;
newNode = (IXML_Node *)newDoc; newNode = (IXML_Node *)newDoc;

View File

@ -313,9 +313,18 @@ int token_cmp(token *in1, token *in2)
return memcmp(in1->buff, in2->buff, in1->size); return memcmp(in1->buff, in2->buff, in1->size);
} }
int parse_hostport( /*!
* \brief Parses a string representing a host and port (e.g. "127.127.0.1:80"
* or "localhost") and fills out a hostport_type struct with internet address
* and a token representing the full host and port.
*
* Uses gethostbyname.
*/
static int parse_hostport(
/*! [in] String of characters representing host and port. */
const char *in, const char *in,
/*size_t max,*/ /*! [out] Output parameter where the host and port are represented as
* an internet address. */
hostport_type *out) hostport_type *out)
{ {
char workbuf[256]; char workbuf[256];
@ -446,7 +455,6 @@ int parse_hostport(
out->text.buff = in; out->text.buff = in;
return (int)hostport_size; return (int)hostport_size;
//max=max;
} }
/*! /*!
@ -706,7 +714,6 @@ int parse_uri(const char *in, size_t max, uri_type *out)
in[begin_hostport + (size_t)1] == '/') { in[begin_hostport + (size_t)1] == '/') {
begin_hostport += (size_t)2; begin_hostport += (size_t)2;
begin_path = parse_hostport(&in[begin_hostport], begin_path = parse_hostport(&in[begin_hostport],
/*max - begin_hostport,*/
&out->hostport); &out->hostport);
if (begin_path >= 0) { if (begin_path >= 0) {
begin_path += (int)begin_hostport; begin_path += (int)begin_hostport;

View File

@ -501,8 +501,6 @@ int DeviceShutdown(
int RootDev, int RootDev,
/* [in] Device UDN. */ /* [in] Device UDN. */
char *Udn, char *Udn,
/* [in] . */
/*char *_Server,*/
/* [in] Location URL. */ /* [in] Location URL. */
char *Location, char *Location,
/* [in] Device duration in sec. */ /* [in] Device duration in sec. */

View File

@ -276,22 +276,6 @@ int token_cmp(
/*! [in] Second token object used for the comparison. */ /*! [in] Second token object used for the comparison. */
token *in2); token *in2);
/*!
* \brief Parses a string representing a host and port (e.g. "127.127.0.1:80"
* or "localhost") and fills out a hostport_type struct with internet address
* and a token representing the full host and port.
*
* Uses gethostbyname.
*/
int parse_hostport(
/*! [in] String of characters representing host and port. */
const char *in,
/*! [in] Sets a maximum limit. */
/*size_t max,*/
/*! [out] Output parameter where the host and port are represented as
* an internet address. */
hostport_type *out);
/*! /*!
* \brief Removes http escaped characters such as: "%20" and replaces them with * \brief Removes http escaped characters such as: "%20" and replaces them with
* their character representation. i.e. "hello%20foo" -> "hello foo". * their character representation. i.e. "hello%20foo" -> "hello foo".

View File

@ -831,7 +831,7 @@ error_handler:
return RetVal; return RetVal;
} }
int DeviceShutdown(char *DevType, int RootDev, char *Udn, /*char *_Server,*/ int DeviceShutdown(char *DevType, int RootDev, char *Udn,
char *Location, int Duration, int AddressFamily, char *Location, int Duration, int AddressFamily,
int PowerState, int SleepPeriod, int RegistrationState) int PowerState, int SleepPeriod, int RegistrationState)
{ {
@ -911,7 +911,6 @@ error_handler:
free(msgs[2]); free(msgs[2]);
return ret_code; return ret_code;
//_Server = _Server;
} }
#endif /* EXCLUDE_SSDP */ #endif /* EXCLUDE_SSDP */
#endif /* INCLUDE_DEVICE_APIS */ #endif /* INCLUDE_DEVICE_APIS */

View File

@ -108,7 +108,6 @@ int AdvertiseAndReply(int AdFlag, UpnpDevice_Handle Hnd,
IXML_Node *tmpNode2 = NULL; IXML_Node *tmpNode2 = NULL;
IXML_Node *textNode = NULL; IXML_Node *textNode = NULL;
const DOMString tmpStr; const DOMString tmpStr;
//char SERVER[200];
const DOMString dbgStr; const DOMString dbgStr;
int NumCopy = 0; int NumCopy = 0;
@ -126,8 +125,6 @@ int AdvertiseAndReply(int AdFlag, UpnpDevice_Handle Hnd,
goto end_function; goto end_function;
} }
defaultExp = SInfo->MaxAge; defaultExp = SInfo->MaxAge;
/* get server info */
//get_sdk_info(SERVER);
/* parse the device list and send advertisements/replies */ /* parse the device list and send advertisements/replies */
while (NumCopy == 0 || (AdFlag && NumCopy < NUM_SSDP_COPY)) { while (NumCopy == 0 || (AdFlag && NumCopy < NUM_SSDP_COPY)) {
if (NumCopy != 0) if (NumCopy != 0)
@ -218,7 +215,7 @@ int AdvertiseAndReply(int AdFlag, UpnpDevice_Handle Hnd,
} else { } else {
/* AdFlag == -1 */ /* AdFlag == -1 */
DeviceShutdown(devType, i == 0lu, UDNstr, DeviceShutdown(devType, i == 0lu, UDNstr,
/*SERVER,*/ SInfo->DescURL, SInfo->DescURL,
Exp, SInfo->DeviceAf, Exp, SInfo->DeviceAf,
SInfo->PowerState, SInfo->PowerState,
SInfo->SleepPeriod, SInfo->SleepPeriod,