Skip to content

Commit

Permalink
trim trailing whitespace
Browse files Browse the repository at this point in the history
This removes needless trailing whitespace in relevant files (excluding
some tests and imported code), by running the following command (and
cleaning up after):

    find . -not \( -name .git -prune \) -type f -print0 | \
        LANG=C LC_CTYPE=C xargs -0 sed -i '' -E "s/[[:space:]]*$//"
  • Loading branch information
mortend committed May 28, 2023
1 parent e070385 commit 43918ec
Show file tree
Hide file tree
Showing 175 changed files with 730 additions and 744 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ If you run into trouble, make sure you have installed [JDK 11](https://adoptium.

### Compiler
- Fixed bug with `abstract extern` members (#273).
- Dropped legacy importer system (#272).
- Dropped legacy importer system (#272).
- Auto-detect main-class when building a library.

### Standard library
Expand Down Expand Up @@ -1103,7 +1103,7 @@ This series of changes are seen as steps to enable where we want to go, we under
@}
}

On foreign Java methods you can also provide annotations.
On foreign Java methods you can also provide annotations.

[ForeignAnnotation(Language.Java, "TargetApi(19)")]
public void Foo()
Expand Down
2 changes: 1 addition & 1 deletion lib/Uno.Graphics.Utils/TextureLoader.uno
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ namespace Uno.Graphics.Utils
return DotNetTexture.Load2D("image.png", bytes);
else
throw new NotImplementedException();
}
}
catch (Exception pngException)
{
// both threw, but since the user asked for JPEG, answer with the JPEG-error
Expand Down
2 changes: 1 addition & 1 deletion lib/Uno.Net.Http/HttpMessageHandlerRequest.uno
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ namespace Uno.Net.Http
{
if(_request.IsComplete())
return;

_request.State = _state;
_action(_request, _current, _total, _hasTotal);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace HttpStatusCodeTester
{ "Via", "" },
{ "Warning", "" }
};

IDictionary<string, string> _requestHeaders = new Dictionary<string, string>
{
{ "Accept", "" },
Expand All @@ -42,7 +42,7 @@ namespace HttpStatusCodeTester
{ "TE", "" },
{ "User-Agent", "" }
};

IDictionary<string, string> _responseHeaders = new Dictionary<string, string>
{
{ "Accept-Ranges", "" },
Expand All @@ -55,7 +55,7 @@ namespace HttpStatusCodeTester
{ "Vary", "" },
{ "WWW-Authenticate", "" }
};

IDictionary<string, string> _entityHeaders = new Dictionary<string, string>
{
{ "Allow", "" },
Expand All @@ -69,15 +69,15 @@ namespace HttpStatusCodeTester
{ "Expires", "" },
{ "Last-Modified", "" }
};

public HeaderTester()
{
foreach(var header in _generalHeaders)
Items.Add(new HeaderTest(header.Key, header.Value));

foreach(var header in _requestHeaders)
Items.Add(new HeaderTest(header.Key, header.Value));

foreach(var header in _entityHeaders)
Items.Add(new HeaderTest(header.Key, header.Value));

Expand All @@ -90,7 +90,7 @@ namespace HttpStatusCodeTester
(item as HeaderTest).Run();
}
}

public class HeaderTest : Grid
{
readonly string _key;
Expand All @@ -101,36 +101,36 @@ namespace HttpStatusCodeTester
readonly Cell _event;
readonly Cell _header;
readonly Cell _body;

public HeaderTest(string key, string value)
{
_key = key;
_value = value;

_client = new HttpWrapper(Callback);

_state = new Cell("State");
_status = new Cell("Status");
_event = new Cell("Event");

_header = new Cell("Header");
_header.Text = _key;
_body = new Cell("Body");

this.RowCount = 1;
this.ColumnCount = 5;

this.Children.Add(_header);
this.Children.Add(_status);
this.Children.Add(_state);
this.Children.Add(_event);
this.Children.Add(_body);
}

void Callback(HttpEvent data)
{
_status.Text = data.StatusCode;

if("200" == data.StatusCode)
_status.Color = float4(0.5f, 1f, 0.5f, 1f);
else
Expand All @@ -139,13 +139,13 @@ namespace HttpStatusCodeTester
_state.Text = data.State;
_event.Text = data.Type;
//this.headers.Text = data.Headers;

_body.Text = (data.Exception != null) ? data.Exception : "false";
if(data.Content != null)

if(data.Content != null)
{
var list = data.Content.Split(',');
foreach(string it in list)
foreach(string it in list)
{
if(it.Trim() == _key)
{
Expand All @@ -155,7 +155,7 @@ namespace HttpStatusCodeTester
}
}
}

public void Run()
{
_client.Run("http://httpbin.org/response-headers?" + _key + "=" + _value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ namespace HttpStatusCodeTester
request.Aborted += Aborted;
request.Error += Error;
request.Timeout += Timeout;

if(headerkey != null && headervalue != null)
request.SetHeader(headerkey, headervalue);

request.SetResponseType(HttpResponseType.String);
request.SendAsync();
}
Expand Down Expand Up @@ -82,7 +82,7 @@ namespace HttpStatusCodeTester
data.Type = eventType;
if(msg != null)
data.Exception = exception;

try
{
if(msg == null)
Expand Down Expand Up @@ -114,7 +114,7 @@ namespace HttpStatusCodeTester
public string Content { get; set; }

public string Type { get; set; }

public string Exception { get; set; }
}
}
2 changes: 1 addition & 1 deletion lib/Uno.Net.Sockets/NetworkStream.uno
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ namespace Uno.Net.Sockets
}

public override void Flush() { }

public virtual bool DataAvailable
{
get { return _socket.Available > 0; }
Expand Down
18 changes: 9 additions & 9 deletions lib/Uno.Testing/Assert.uno
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ namespace Uno.Testing

/**
Asserts that `actual` is equal to `expected`
If `tolerance` is given, asserts that `actual` and `expected` do not differ by more than `tolerance`
(Do not use the `filePath`, `lineNumber` and `memberName` arguments, as these are filled in automatically)
Expand All @@ -277,7 +277,7 @@ namespace Uno.Testing

/**
Asserts that `actual` is equal to `expected`
If `tolerance` is given, asserts that `actual` and `expected` do not differ by more than `tolerance`
(Do not use the `filePath`, `lineNumber` and `memberName` arguments, as these are filled in automatically)
Expand Down Expand Up @@ -331,7 +331,7 @@ namespace Uno.Testing

/**
Asserts that `actual` is not equal to `expected`
If `tolerance` is given, asserts that `actual` and `expected` differ by more than `tolerance`
(Do not use the `filePath`, `lineNumber` and `memberName` arguments, as these are filled in automatically)
Expand All @@ -345,7 +345,7 @@ namespace Uno.Testing

/**
Asserts that `actual` is not equal to `expected`
If `tolerance` is given, asserts that `actual` and `expected` differ by more than `tolerance`
(Do not use the `filePath`, `lineNumber` and `memberName` arguments, as these are filled in automatically)
Expand Down Expand Up @@ -399,7 +399,7 @@ namespace Uno.Testing

/**
Asserts that `actual` is equal to `expected`
If `tolerance` is given, asserts that each element of `actual` and `expected` do not differ by more than `tolerance`
(Do not use the `filePath`, `lineNumber` and `memberName` arguments, as these are filled in automatically)
Expand All @@ -413,7 +413,7 @@ namespace Uno.Testing

/**
Asserts that `actual` is equal to `expected`
If `tolerance` is given, asserts that each element of `actual` and `expected` do not differ by more than `tolerance`
(Do not use the `filePath`, `lineNumber` and `memberName` arguments, as these are filled in automatically)
Expand All @@ -427,7 +427,7 @@ namespace Uno.Testing

/**
Asserts that `actual` is equal to `expected`
If `tolerance` is given, asserts that each element of `actual` and `expected` do not differ by more than `tolerance`
(Do not use the `filePath`, `lineNumber` and `memberName` arguments, as these are filled in automatically)
Expand All @@ -441,7 +441,7 @@ namespace Uno.Testing

/**
Asserts that `actual` is equal to `expected`
If `tolerance` is given, asserts that each element of `actual` and `expected` do not differ by more than `tolerance`
(Do not use the `filePath`, `lineNumber` and `memberName` arguments, as these are filled in automatically)
Expand All @@ -457,7 +457,7 @@ namespace Uno.Testing

/**
Asserts that `actual` is equal to `expected`
If `tolerance` is given, asserts that each element of `actual` and `expected` do not differ by more than `tolerance`
(Do not use the `filePath`, `lineNumber` and `memberName` arguments, as these are filled in automatically)
Expand Down
6 changes: 3 additions & 3 deletions lib/Uno.Threading/Promise.uno
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace Uno.Threading
return success;
}
void onSuccess(bool value)
void onSuccess(bool value)
{
//Success!
}
Expand All @@ -29,7 +29,7 @@ namespace Uno.Threading
{
// Oh no!
}
public void DoSomeFancyStuff()
{
var promise = Promise.Run(doStuff).Then(onSuccess, onFail);
Expand All @@ -38,7 +38,7 @@ namespace Uno.Threading
## Make your own promises
You can also extend `Promise` and handle it yourself. Simply call `Resolve` or `Reject` once you have a result or a failure. The [Native Facebook login example](https://github.com/fuse-open/fuse-samples/blob/feature-NativeFacebookLogin/Samples/NativeFacebookLogin/FacebookLogin/FacebookLoginModule.uno) is a good example of this being done in practice.
Notice that `Resolve` and `Reject` are public, so you can also theoretically both resolve and reject promises from elsewhere.
# Making Promises accessible from JavaScript modules
Expand Down
6 changes: 3 additions & 3 deletions lib/UnoCore/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
package="@(Activity.Package)">

#if @(Project.Android.SupportsScreens.Resizable:IsSet) || @(Project.Android.SupportsScreens.SmallScreens:IsSet) || @(Project.Android.SupportsScreens.NormalScreens:IsSet) || @(Project.Android.SupportsScreens.LargeScreens:IsSet) || @(Project.Android.SupportsScreens.XLargeScreens:IsSet) || @(Project.Android.SupportsScreens.AnyDensity:IsSet) || @(Project.Android.SupportsScreens.RequiresSmallestWidthDp:IsSet) || @(Project.Android.SupportsScreens.CompatibleWidthLimitDp:IsSet) || @(Project.Android.SupportsScreens.LargestWidthLimitDp:IsSet)
<supports-screens
<supports-screens
#if @(Project.Android.SupportsScreens.Resizable:IsSet)
android:resizeable="@(Project.Android.SupportsScreens.Resizable:ToLower)"
#endif
Expand Down Expand Up @@ -35,7 +35,7 @@
#endif
/>
#endif

#if @(Project.Android.SupportsAndroidGo:Test(1, 0))
<uses-feature android:name="android.hardware.ram.low" android:required="true"/>
#endif
Expand Down Expand Up @@ -143,7 +143,7 @@
#endif
@(AndroidManifest.Activity.ViewIntentFilter:Join('\n ', '<data ', '/>'))
</intent-filter>

#if @(Project.Android.AssociatedDomains:IsSet)
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
Expand Down
8 changes: 4 additions & 4 deletions lib/UnoCore/android/com/fuse/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public void onCreate(Bundle savedInstanceState)

// call c++ for setup
ActivityNativeEntryPoints.cppOnCreate(RootActivity);

// reset window background for app switcher to be able to take a screenshot of app content
#if @(Project.Android.Splash.Enabled:Test(1, 0))
RootActivity.getWindow().setBackgroundDrawableResource(android.R.color.transparent);
Expand Down Expand Up @@ -225,12 +225,12 @@ public void onNewIntent (Intent intent)
#endif

#if @(Project.Android.AssociatedDomains:IsSet)
String[] associatedDomains = new String[]{@(Project.Android.AssociatedDomains:SplitAndJoin(',','"','"'))};
String[] associatedDomains = new String[]{@(Project.Android.AssociatedDomains:SplitAndJoin(',','"','"'))};

for (int i = 0; i < associatedDomains.length; i++) {

if (intent!=null && intent.getScheme()!=null && intent.getScheme().contains("http")
&& intent.getDataString().toLowerCase().contains(new String(associatedDomains[i]).toLowerCase())) {
if (intent!=null && intent.getScheme()!=null && intent.getScheme().contains("http")
&& intent.getDataString().toLowerCase().contains(new String(associatedDomains[i]).toLowerCase())) {
pendingURI = intent.getDataString();
break;
}
Expand Down
6 changes: 3 additions & 3 deletions lib/UnoCore/cpp/Uno/ObjectModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ static std::string uTypeString(uType* type, bool includeAddress = true)

if (includeAddress)
sb << " 0x" << type;

return sb.str();
}
#endif
Expand Down Expand Up @@ -615,7 +615,7 @@ static void uVerifyBuild(uType* type)
if (type->InterfaceCount)
{
struct {
bool operator ()(const uInterfaceInfo& a, const uInterfaceInfo& b)
bool operator ()(const uInterfaceInfo& a, const uInterfaceInfo& b)
{
return a.Type < b.Type;
}
Expand Down Expand Up @@ -975,7 +975,7 @@ uString* uString::Utf8(const char* mutf8, size_t length)

char* src = const_cast<char*>(mutf8);
size_t null_count = 0;

// Check for modified UTF-8
for (size_t i = 0; i < length - 1; i++)
{
Expand Down
Loading

0 comments on commit 43918ec

Please sign in to comment.