Skip to content

Commit

Permalink
Reformatted code according to the updated .clang-format configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
cybergarage committed Dec 23, 2024
1 parent 1d732e3 commit 2e452ef
Show file tree
Hide file tree
Showing 14 changed files with 82 additions and 82 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,21 +61,21 @@ - (void)viewDidLoad
if (![presentationURL hasPrefix:@"http://"]) {
if (urlBase != nil && 0 < [urlBase length]) {
self.presentationURL = [NSString stringWithFormat:@"%@%@",
[device urlBase],
[device presentationURL]];
[device urlBase],
[device presentationURL]];
}
else if (ssdpLocationURL != nil && 0 < [ssdpLocationURL length]) {
self.presentationURL = [NSString stringWithFormat:@"%@%@",
[device locationURL],
[device presentationURL]];
[device locationURL],
[device presentationURL]];
}
}
NSLog(@"presentatilURL = %@", presentationURL);

[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES];

[webView loadRequest:[NSURLRequest requestWithURL:
[NSURL URLWithString:presentationURL]]];
[NSURL URLWithString:presentationURL]]];
}

- (void)webViewDidFinishLoad:(UIWebView*)webView
Expand All @@ -90,7 +90,7 @@ - (void)webView:(UIWebView*)webView didFailLoadWithError:(NSError*)error
NSString* errMsg = [error localizedFailureReason];
if (errMsg == nil || [errMsg length] <= 0) {
errMsg = [NSString stringWithFormat:@"Presentation URL is invalid !! (%@)",
[self presentationURL]];
[self presentationURL]];
}

UIAlertView* alert = [[UIAlertView alloc] initWithTitle:@"iNetFrame"
Expand Down
30 changes: 15 additions & 15 deletions examples/upnpbrowser/ios/Classes/UPnPTableViewCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ - (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString*)reuseIdentifier
[self.contentView addSubview:imageView];

UILabel* nameLabel = [[[UILabel alloc] initWithFrame:
CGRectMake(
imgCellWidth,
0,
cellWidth - imgCellWidth,
(cellHeight - UPNPAVOBJECT_CELL_LOW_HEIGHT))] autorelease];
CGRectMake(
imgCellWidth,
0,
cellWidth - imgCellWidth,
(cellHeight - UPNPAVOBJECT_CELL_LOW_HEIGHT))] autorelease];
nameLabel.tag = UPNPAVOBJECT_CELL_NAME;
nameLabel.font = [UIFont systemFontOfSize:UPNPAVOBJECT_CELL_HEIGHT_FONT_SIZE];
nameLabel.textAlignment = UITextAlignmentLeft;
Expand All @@ -56,11 +56,11 @@ - (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString*)reuseIdentifier
[self.contentView addSubview:nameLabel];

UILabel* mimeLabel = [[[UILabel alloc] initWithFrame:
CGRectMake(
imgCellWidth,
(cellHeight - UPNPAVOBJECT_CELL_LOW_HEIGHT),
((cellWidth - imgCellWidth) / 2),
UPNPAVOBJECT_CELL_LOW_HEIGHT)] autorelease];
CGRectMake(
imgCellWidth,
(cellHeight - UPNPAVOBJECT_CELL_LOW_HEIGHT),
((cellWidth - imgCellWidth) / 2),
UPNPAVOBJECT_CELL_LOW_HEIGHT)] autorelease];
mimeLabel.tag = UPNPAVOBJECT_CELL_MIME;
mimeLabel.font = [UIFont systemFontOfSize:UPNPAVOBJECT_CELL_LOW_FONT_SIZE];
mimeLabel.textAlignment = UITextAlignmentLeft;
Expand All @@ -69,11 +69,11 @@ - (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString*)reuseIdentifier
[self.contentView addSubview:mimeLabel];

UILabel* dateLabel = [[[UILabel alloc] initWithFrame:
CGRectMake(
(imgCellWidth + ((cellWidth - imgCellWidth) / 2)),
(cellHeight - UPNPAVOBJECT_CELL_LOW_HEIGHT),
((cellWidth - imgCellWidth) / 2),
UPNPAVOBJECT_CELL_LOW_HEIGHT)] autorelease];
CGRectMake(
(imgCellWidth + ((cellWidth - imgCellWidth) / 2)),
(cellHeight - UPNPAVOBJECT_CELL_LOW_HEIGHT),
((cellWidth - imgCellWidth) / 2),
UPNPAVOBJECT_CELL_LOW_HEIGHT)] autorelease];
dateLabel.tag = UPNPAVOBJECT_CELL_DATE;
dateLabel.font = [UIFont systemFontOfSize:UPNPAVOBJECT_CELL_LOW_FONT_SIZE];
dateLabel.textAlignment = UITextAlignmentRight;
Expand Down
4 changes: 2 additions & 2 deletions examples/upnpdump/upnpdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,8 @@ void ControlDeviceAlter(mUpnpControlPoint* ctrlPoint, int alteration_mask)
mupnp_sleep(3000);

for (arg = mupnp_action_getarguments(selAction);
arg;
arg = mupnp_argument_next(arg)) {
arg;
arg = mupnp_argument_next(arg)) {
if (mupnp_argument_isoutdirection(arg) == true)
printf(" %s = %s\n",
mupnp_argument_getname(arg),
Expand Down
20 changes: 10 additions & 10 deletions src/mupnp/controlpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,8 @@ bool mupnp_controlpoint_stop(mUpnpControlPoint* ctrlPoint)
/* Unsubscribe from all services */

for (dev = mupnp_controlpoint_getdevices(ctrlPoint);
dev != NULL;
dev = mupnp_device_next(dev)) {
dev != NULL;
dev = mupnp_device_next(dev)) {
udn = mupnp_device_getudn(dev);

/* Call device listener for each device */
Expand Down Expand Up @@ -405,8 +405,8 @@ mUpnpDevice* mupnp_controlpoint_getdevicebyexacttype(mUpnpControlPoint* ctrlPoin
}

for (dev = mupnp_controlpoint_getdevices(ctrlPoint);
dev != NULL;
dev = mupnp_device_next(dev)) {
dev != NULL;
dev = mupnp_device_next(dev)) {
if (mupnp_strcmp(mupnp_device_getdevicetype(dev),
exacttype)
== 0) {
Expand Down Expand Up @@ -449,8 +449,8 @@ mUpnpDevice* mupnp_controlpoint_getdevicebytype(mUpnpControlPoint* ctrlPoint, co
}

for (dev = mupnp_controlpoint_getdevices(ctrlPoint);
dev != NULL;
dev = mupnp_device_next(dev)) {
dev != NULL;
dev = mupnp_device_next(dev)) {
typeString = mupnp_device_getdevicetype(dev);
if (typeString != NULL) {
part = mupnp_devicetype_getschematype(typeString);
Expand Down Expand Up @@ -494,8 +494,8 @@ mUpnpDevice* mupnp_controlpoint_getdevicebyudn(mUpnpControlPoint* ctrlPoint, con
}

for (dev = mupnp_controlpoint_getdevices(ctrlPoint);
dev != NULL;
dev = mupnp_device_next(dev)) {
dev != NULL;
dev = mupnp_device_next(dev)) {
if (mupnp_strcmp(mupnp_device_getudn(dev), udn) == 0) {
return dev;
}
Expand Down Expand Up @@ -802,8 +802,8 @@ bool mupnp_controlpoint_ipchanged(mUpnpControlPoint* ctrlPoint)

/* Remove all devices registered through old interface */
for (netIf = mupnp_net_interfacelist_gets(removed);
netIf != NULL;
netIf = mupnp_net_interface_next(netIf)) {
netIf != NULL;
netIf = mupnp_net_interface_next(netIf)) {
mupnp_controlpoint_lock(ctrlPoint);
tmp = mupnp_controlpoint_getdevices(ctrlPoint);
while (tmp != NULL) {
Expand Down
8 changes: 4 additions & 4 deletions src/mupnp/controlpoint_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ mUpnpService* mupnp_device_getfirstexpiratedservice(mUpnpControlPoint* ctrlPoint
currTime = mupnp_getcurrentsystemtime();

for (srv = mupnp_device_getservices(dev); srv != NULL;
srv = mupnp_service_next(srv)) {
srv = mupnp_service_next(srv)) {
if (mupnp_service_issubscribed(srv) == false)
continue;

Expand Down Expand Up @@ -80,7 +80,7 @@ mUpnpService* mupnp_device_getfirstexpiratedservice(mUpnpControlPoint* ctrlPoint
}

for (childDev = mupnp_device_getdevices(dev); childDev != NULL;
childDev = mupnp_device_next(childDev)) {
childDev = mupnp_device_next(childDev)) {
srv = mupnp_device_getfirstexpiratedservice(ctrlPoint,
childDev,
expirationTime);
Expand Down Expand Up @@ -122,8 +122,8 @@ void mupnp_controlpoint_expirationhandler(mUpnpThread* thread)
mupnp_controlpoint_lock(ctrlPoint);

for (dev = mupnp_controlpoint_getdevices(ctrlPoint);
dev != NULL;
dev = mupnp_device_next(dev)) {
dev != NULL;
dev = mupnp_device_next(dev)) {
/* Check device expiration */
mupnp_log_debug_s("Checking device expiration.\n");
ssdpPkt = mupnp_device_getssdppacket(dev);
Expand Down
12 changes: 6 additions & 6 deletions src/mupnp/controlpoint_http_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ void mupnp_controlpoint_httprequestreceived(mUpnpHttpRequest* httpReq)
sid = mupnp_event_notify_request_getsid(notifyReq);

for (dev = mupnp_controlpoint_getdevices(ctrlPoint);
dev != NULL;
dev = mupnp_device_next(dev)) {
dev != NULL;
dev = mupnp_device_next(dev)) {
service = mupnp_device_getservicebysid(dev, sid);
if (service != NULL)
break;
Expand Down Expand Up @@ -83,8 +83,8 @@ void mupnp_controlpoint_httprequestreceived(mUpnpHttpRequest* httpReq)
notifyListeners = 1;
propList = mupnp_event_notify_request_getpropertylist(notifyReq);
for (prop = mupnp_propertylist_gets(propList);
prop != NULL;
prop = mupnp_property_next(prop)) {
prop != NULL;
prop = mupnp_property_next(prop)) {
/* Update the service's state table from the event */
mupnp_controlpoint_updatestatetablefromproperty(service, prop);
}
Expand All @@ -96,8 +96,8 @@ void mupnp_controlpoint_httprequestreceived(mUpnpHttpRequest* httpReq)
if (notifyListeners && propList != NULL) {
/* Notify listeners out of control point lock */
for (prop = mupnp_propertylist_gets(propList);
prop != NULL;
prop = mupnp_property_next(prop)) {
prop != NULL;
prop = mupnp_property_next(prop)) {
mupnp_eventlistenerlist_notify(eventListeners, prop);
}
}
Expand Down
36 changes: 18 additions & 18 deletions src/mupnp/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -851,8 +851,8 @@ mUpnpDevice* mupnp_device_getdevicebytype(mUpnpDevice* dev, const char* type)
}

for (childDev = mupnp_device_getdevices(dev);
childDev != NULL;
childDev = mupnp_device_next(childDev)) {
childDev != NULL;
childDev = mupnp_device_next(childDev)) {
typeString = mupnp_device_getdevicetype(childDev);
if (typeString != NULL) {
part = mupnp_devicetype_getschematype(typeString);
Expand Down Expand Up @@ -899,8 +899,8 @@ mUpnpDevice* mupnp_device_getdevicebyexacttype(mUpnpDevice* dev, const char* exa
}

for (childDev = mupnp_device_getdevices(dev);
childDev != NULL;
childDev = mupnp_device_next(childDev)) {
childDev != NULL;
childDev = mupnp_device_next(childDev)) {
if (mupnp_strcmp(mupnp_device_getdevicetype(childDev),
exacttype)
== 0) {
Expand Down Expand Up @@ -938,8 +938,8 @@ mUpnpDevice* mupnp_device_getdevicebyudn(mUpnpDevice* dev, const char* udn)
}

for (childDev = mupnp_device_getdevices(dev);
childDev != NULL;
childDev = mupnp_device_next(childDev)) {
childDev != NULL;
childDev = mupnp_device_next(childDev)) {
if (mupnp_strcmp(mupnp_device_getudn(childDev), udn) == 0) {
return childDev;
}
Expand Down Expand Up @@ -1530,8 +1530,8 @@ mUpnpService* mupnp_device_getservicebyserviceid(mUpnpDevice* dev, const char* s
}

for (service = mupnp_device_getservices(dev);
service != NULL;
service = mupnp_service_next(service)) {
service != NULL;
service = mupnp_service_next(service)) {
if (mupnp_strcmp(mupnp_service_getserviceid(service),
serviceId)
== 0) {
Expand All @@ -1544,8 +1544,8 @@ mUpnpService* mupnp_device_getservicebyserviceid(mUpnpDevice* dev, const char* s
}

for (childDev = mupnp_device_getdevices(dev);
childDev != NULL;
childDev = mupnp_device_next(childDev)) {
childDev != NULL;
childDev = mupnp_device_next(childDev)) {
service = mupnp_device_getservicebyserviceid(childDev, serviceId);
if (service != NULL) {
return service;
Expand Down Expand Up @@ -1580,8 +1580,8 @@ mUpnpService* mupnp_device_getservicebyexacttype(mUpnpDevice* dev, const char* t
}

for (service = mupnp_device_getservices(dev);
service != NULL;
service = mupnp_service_next(service)) {
service != NULL;
service = mupnp_service_next(service)) {
if (mupnp_strcmp(mupnp_service_getservicetype(service),
type)
== 0) {
Expand All @@ -1594,8 +1594,8 @@ mUpnpService* mupnp_device_getservicebyexacttype(mUpnpDevice* dev, const char* t
}

for (childDev = mupnp_device_getdevices(dev);
childDev != NULL;
childDev = mupnp_device_next(childDev)) {
childDev != NULL;
childDev = mupnp_device_next(childDev)) {
service = mupnp_device_getservicebyexacttype(childDev, type);
if (service != NULL) {
return service;
Expand Down Expand Up @@ -1632,8 +1632,8 @@ mUpnpService* mupnp_device_getservicebytype(mUpnpDevice* dev, const char* type)
}

for (service = mupnp_device_getservices(dev);
service != NULL;
service = mupnp_service_next(service)) {
service != NULL;
service = mupnp_service_next(service)) {
typeString = mupnp_service_getservicetype(service);
if (typeString != NULL) {
if (mupnp_strcmp(typeString, type) == 0)
Expand All @@ -1654,8 +1654,8 @@ mUpnpService* mupnp_device_getservicebytype(mUpnpDevice* dev, const char* type)
}

for (childDev = mupnp_device_getdevices(dev);
childDev != NULL;
childDev = mupnp_device_next(childDev)) {
childDev != NULL;
childDev = mupnp_device_next(childDev)) {
service = mupnp_device_getservicebytype(childDev, type);
if (service != NULL) {
return service;
Expand Down
8 changes: 4 additions & 4 deletions src/mupnp/event/eventlistener_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ void mupnp_eventlistenerlist_remove(mUpnpEventListenerList* eventListenerList, M
return;

for (list_node = mupnp_eventlistenerlist_gets(eventListenerList);
list_node != NULL;
list_node = mupnp_eventlistenerlist_next(list_node)) {
list_node != NULL;
list_node = mupnp_eventlistenerlist_next(list_node)) {
if (list_node->listener == listener) {
mupnp_list_remove((mUpnpList*)list_node);
free(list_node);
Expand Down Expand Up @@ -122,8 +122,8 @@ void mupnp_eventlistenerlist_notify(mUpnpEventListenerList* eventListenerList, m
mupnp_log_debug_l4("Entering...\n");

for (list_node = mupnp_eventlistenerlist_gets(eventListenerList);
list_node != NULL;
list_node = mupnp_eventlistenerlist_next(list_node)) {
list_node != NULL;
list_node = mupnp_eventlistenerlist_next(list_node)) {
if (list_node->listener != NULL) {
list_node->listener(property);
}
Expand Down
12 changes: 6 additions & 6 deletions src/mupnp/http/http_persistent_connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ void* mupnp_http_persistentconnection_get(char* host, int port)
do {
iterate = false;
for (node = (mUpnpHttpPersistentConnection*)mupnp_list_gets((mUpnpList*)cache);
node != NULL;
node = (mUpnpHttpPersistentConnection*)mupnp_list_next((mUpnpList*)node)) {
node != NULL;
node = (mUpnpHttpPersistentConnection*)mupnp_list_next((mUpnpList*)node)) {
if (sys_time > node->timestamp + MUPNP_HTTP_PERSISTENT_TIMEOUT_PERIOD) {
mupnp_log_debug_s("Timeout for persistent HTTP Connection to %s:%d "
"(timestamp: %d)\n",
Expand All @@ -174,8 +174,8 @@ void* mupnp_http_persistentconnection_get(char* host, int port)

/* Get persistent node */
for (node = (mUpnpHttpPersistentConnection*)mupnp_list_gets((mUpnpList*)cache);
node != NULL;
node = (mUpnpHttpPersistentConnection*)mupnp_list_next((mUpnpList*)node)) {
node != NULL;
node = (mUpnpHttpPersistentConnection*)mupnp_list_next((mUpnpList*)node)) {
if (mupnp_strcmp(mupnp_string_getvalue(node->host), host) == 0 && node->port == port) {
/* Node was required, remove and add again to refresh cache */
mupnp_list_remove((mUpnpList*)node);
Expand Down Expand Up @@ -214,8 +214,8 @@ bool mupnp_http_persistentconnection_put(char* host, int port, void* data)

/* Check if we already have this one cached */
for (node = (mUpnpHttpPersistentConnection*)mupnp_list_gets((mUpnpList*)cache);
node != NULL;
node = (mUpnpHttpPersistentConnection*)mupnp_list_next((mUpnpList*)node)) {
node != NULL;
node = (mUpnpHttpPersistentConnection*)mupnp_list_next((mUpnpList*)node)) {
if (mupnp_strcmp(mupnp_string_getvalue(node->host), host) == 0 && node->port == port) {
/* If also data is the same, then update just
timestamp */
Expand Down
4 changes: 2 additions & 2 deletions src/mupnp/net/interface_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ void mupnp_net_interfacelist_getchanges(mUpnpNetworkInterfaceList* netIfListOld,

found = false;
for (netIfNew = mupnp_net_interfacelist_gets(netIfListNew); netIfNew != NULL;
netIfNew = mupnp_net_interface_next(netIfNew)) {
netIfNew = mupnp_net_interface_next(netIfNew)) {
if (mupnp_net_interface_cmp(netIfOld, netIfNew) == 0) {
found = true;
break;
Expand All @@ -124,7 +124,7 @@ void mupnp_net_interfacelist_getchanges(mUpnpNetworkInterfaceList* netIfListOld,

found = false;
for (netIfOld = mupnp_net_interfacelist_gets(netIfListOld); netIfOld != NULL;
netIfOld = mupnp_net_interface_next(netIfOld)) {
netIfOld = mupnp_net_interface_next(netIfOld)) {
if (mupnp_net_interface_cmp(netIfOld, netIfNew) == 0) {
found = true;
break;
Expand Down
2 changes: 1 addition & 1 deletion src/mupnp/net/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ ssize_t mupnp_socket_recv(mUpnpSocket* sock, mUpnpDatagramPacket* dgmPkt)
char remoteAddr[MUPNP_NET_SOCKET_MAXHOST];
char remotePort[MUPNP_NET_SOCKET_MAXSERV];
char* localAddr;

#if defined(BTRON) || (defined(TENGINE) && !defined(MUPNP_TENGINE_NET_KASAGO))
struct sockaddr_in from;
W fromLen = sizeof(from);
Expand Down
Loading

0 comments on commit 2e452ef

Please sign in to comment.