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(
/*! [in] The XML parser. */
Parser *xmlParser,
/*! [in] The Node to process. */
/*IXML_Node *newNode,*/
/*! [in,out] The name space URI. */
char **nsURI )
{
@ -2165,7 +2163,6 @@ static BOOL Parser_hasDefaultNamespace(
}
return FALSE;
//newNode = newNode;
}
@ -2218,7 +2215,7 @@ static int Parser_processElementName(
} else {
/* does element has default namespace */
/* the node may have default namespace definition */
if (Parser_hasDefaultNamespace(xmlParser, /*newNode,*/ &nsURI)) {
if (Parser_hasDefaultNamespace(xmlParser, &nsURI)) {
Parser_setElementNamespace(newElement, nsURI);
} else {
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
* just mallocs the IXML_Document, sets the node type and name. Curiously,
* the parameter nodeptr is not actually used.
* just mallocs the IXML_Document, sets the node type and name.
*
* \return A clone of a document node.
* \return A new document node.
*/
static IXML_Document *ixmlNode_cloneDoc(
/*! [in] The \b Node to clone. */
/*IXML_Document *nodeptr*/)
static IXML_Document *ixmlNode_newDoc(void)
{
IXML_Document *newDoc;
IXML_Node *docNode;
int rc;
//assert(nodeptr != NULL);
newDoc = (IXML_Document *)malloc(sizeof (IXML_Document));
if (newDoc == NULL) {
if (!newDoc)
return NULL;
}
ixmlDocument_init(newDoc);
docNode = (IXML_Node *)newDoc;
rc = ixmlNode_setNodeName(docNode, DOCUMENTNODENAME);
if (rc != IXML_SUCCESS) {
ixmlDocument_free(newDoc);
return NULL;
}
newDoc->n.nodeType = eDOCUMENT_NODE;
return newDoc;
//nodeptr = nodeptr;
}
/*!
@ -968,7 +958,7 @@ static IXML_Node *ixmlNode_cloneNodeTreeRecursive(
break;
case eDOCUMENT_NODE:
newDoc = ixmlNode_cloneDoc(/*(IXML_Document *)nodeptr*/);
newDoc = ixmlNode_newDoc();
if (newDoc == NULL)
return NULL;
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);
}
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,
/*size_t max,*/
/*! [out] Output parameter where the host and port are represented as
* an internet address. */
hostport_type *out)
{
char workbuf[256];
@ -446,7 +455,6 @@ int parse_hostport(
out->text.buff = in;
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] == '/') {
begin_hostport += (size_t)2;
begin_path = parse_hostport(&in[begin_hostport],
/*max - begin_hostport,*/
&out->hostport);
if (begin_path >= 0) {
begin_path += (int)begin_hostport;

View File

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

View File

@ -276,22 +276,6 @@ int token_cmp(
/*! [in] Second token object used for the comparison. */
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
* their character representation. i.e. "hello%20foo" -> "hello foo".

View File

@ -831,7 +831,7 @@ error_handler:
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,
int PowerState, int SleepPeriod, int RegistrationState)
{
@ -911,7 +911,6 @@ error_handler:
free(msgs[2]);
return ret_code;
//_Server = _Server;
}
#endif /* EXCLUDE_SSDP */
#endif /* INCLUDE_DEVICE_APIS */

View File

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