From e34f2638372c698a71645c145bc4e617817a5ab1 Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Sun, 19 Jul 2015 09:56:54 -0500 Subject: [PATCH] haikudepot: Fix style issues in hrev49418 --- src/apps/haikudepot/model/WebAppInterface.cpp | 18 +++++++++--------- src/apps/haikudepot/ui/App.cpp | 10 +++++----- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/apps/haikudepot/model/WebAppInterface.cpp b/src/apps/haikudepot/model/WebAppInterface.cpp index e8d51373a5..78ed19e306 100644 --- a/src/apps/haikudepot/model/WebAppInterface.cpp +++ b/src/apps/haikudepot/model/WebAppInterface.cpp @@ -324,14 +324,14 @@ static bool arguments_is_url_valid(const BString& value) { if (value.Length() < 8) { - fprintf(stderr,"the url is less than 8 characters in length\n"); + fprintf(stderr, "the url is less than 8 characters in length\n"); return false; } int32 schemeEnd = value.FindFirst("://"); - if (schemeEnd == B_ERROR) { - fprintf(stderr,"the url does not contain the '://' string\n"); + if (schemeEnd < B_OK) { + fprintf(stderr, "the url does not contain the '://' string\n"); return false; } @@ -339,12 +339,12 @@ arguments_is_url_valid(const BString& value) value.CopyInto(scheme, 0, schemeEnd); if (scheme != "http" && scheme != "https") { - fprintf(stderr,"the url scheme should be 'http' or 'https'\n"); + fprintf(stderr, "the url scheme should be 'http' or 'https'\n"); return false; } - if (value.Length()-1 == value.FindLast("/")) { - fprintf(stderr,"the url should be be terminated with a '/'\n"); + if (value.Length() - 1 == value.FindLast("/")) { + fprintf(stderr, "the url should be be terminated with a '/'\n"); return false; } @@ -356,9 +356,9 @@ arguments_is_url_valid(const BString& value) indicate if the URL was acceptable. \return B_OK if the base URL was valid and B_BAD_VALUE if not. */ - status_t -WebAppInterface::SetBaseUrl(const BString& url) { +WebAppInterface::SetBaseUrl(const BString& url) +{ if (!arguments_is_url_valid(url)) return B_BAD_VALUE; @@ -691,7 +691,7 @@ BString WebAppInterface::_FormFullUrl(const BString& suffix) const { if (fBaseUrl.IsEmpty()) { - fprintf(stderr,"illegal state - missing web app base url\n"); + fprintf(stderr, "illegal state - missing web app base url\n"); exit(EXIT_FAILURE); } diff --git a/src/apps/haikudepot/ui/App.cpp b/src/apps/haikudepot/ui/App.cpp index 95a1a85f38..9fa06bd1f7 100644 --- a/src/apps/haikudepot/ui/App.cpp +++ b/src/apps/haikudepot/ui/App.cpp @@ -121,22 +121,22 @@ App::ArgvReceived(int32 argc, char* argv[]) for (int i = 1; i < argc;) { if (0 == strcmp("--webappbaseurl", argv[i])) { if (i == argc-1) { - fprintf(stderr,"unexpected end of arguments; missing web app base url\n"); + fprintf(stderr, "unexpected end of arguments; missing web app base url\n"); Quit(); } - if (B_OK != WebAppInterface::SetBaseUrl(argv[i+1])) { - fprintf(stderr,"malformed web app base url; %s\n", argv[i+1]); + if (WebAppInterface::SetBaseUrl(argv[i + 1]) != B_OK) { + fprintf(stderr, "malformed web app base url; %s\n", argv[i + 1]); Quit(); } else - fprintf(stderr,"did configure the web base url; %s\n",argv[i+1]); + fprintf(stderr, "did configure the web base url; %s\n",argv[i + 1]); i += 2; } else { BEntry entry(argv[i], true); _Open(entry); - i ++; + i++; } } }