Why is sometimes C code wrapped in curly braces without declaring a variable in them? for example (from the source code of FreeRTOS, the file 'tasks.c'):
portENTER_CRITICAL(); { xTicks = xTickCount; } portEXIT_CRITICAL();
This is only an internal area. The advantage is that the code shows your intention in this case. For example, this scope is critical.
There is no need to use braces like this, but it helps to read.
This is a style choice by the author, I guess :)
Source: https://habr.com/ru/post/1299746/More articles:jQuery load () memory leak method? - javascriptHow to create a general method to return a specific type specified in a call? - genericsAttach a non-breaking space string in Powershell - powershellCannot Find Region in RegionManager (using PRISM) - wpfGetting DISTINCT users in Google App Engine - pythonUsing a modified Radix tree to implement a URL matching algorithm - c ++Double-click inside UIScrollView to another view - iphoneHow can I sort the ping SMTP server so that I can check if the account / password is valid? - c #Algorithm Refactoring - c ++The right conversions for image scaling - androidAll Articles