Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » U++ community news and announcements » 2024rc1
Re: 2024rc1 [message #60963 is a reply to message #60961] Mon, 14 October 2024 16:23 Go to previous messageGo to previous message
Lance is currently offline  Lance
Messages: 656
Registered: March 2007
Contributor
mirek wrote on Mon, 14 October 2024 10:13
Lance wrote on Sat, 12 October 2024 20:20
Code Reformat Issue.

I have been having issues with it for a while. Today I spend a few hours to create a almost mininal example.
#include <CtrlLib/CtrlLib.h>
using namespace Upp;

class S{
	void Set ( Size& sz,
					   int x, int y, int z,
					   int x1, int y1, int z1
					 );

	const S& f(Rect& r, Rect& s)const;
	
	struct D
	{
		int s(int rc)const
		{
			return rc*2;
		}
		
		int e(int rc)const
		{
			return rc*1;
		}
		
		int w(int rc)const
		{
			return rc*3;
		}
		
		int t()const
		{
			return 4;
		}
		
		
		int g(int k)const
		{
			return k;
		}

		void alloc();
		
		void alloc(int a);
		
		int v1;
		int v2;
	};
	D col,row;
};


void S::D::alloc ()
{
}

static void func ( int& x, int& y, int& x1, int& y1, int x2, int y2,
					int x3, int y3, int x4, int y4
				  )
{
}


const S& S::f(Rect& r, Rect& s)const
{
	int t, l, row_section_bottom, n;
	r.top = row.g(r.top);
	s.top = t !=0 && r.top<row.v1 ? row.v1 : r.top;
	
	r.left = col.g(r.left);
	s.left = l != 0 && r.left< col.v1 ? col.v1 : r.left;

	r.bottom = row.g(r.bottom);
	s.bottom = row_section_bottom == 1  && r.bottom > row.v1 + row.v2 ?
		row.v1+row.v2 : r.bottom;

	r.right = col.g(r.right);
	s.right = n == 1  && r.right> col.v1 + col.v2 ?
		col.v1+col.v2 : r.right;
	return *this;
}




Add the code as a separate cpp file in a CtrlLib application, with it current, press Ctrl+I to reformat it. The file before reformat compiles fine, not the reformatted one.


Works for me in windows and works in Ubuntu. Unfortunately, this feature is now using clang-format that can be different per distro...

Would be nice to give me a hint which host platform is in use...

Also, if nothing helps, please post reformatted text as well.

Mirek


Operation System: Ubuntu 24.04.1 LTS
GNOME version: 46
Windowing System: Wayland
clang-format --version: Ubuntu clang-format version 18.1.3 (1ubuntu1)

Reformatted output
#include <CtrlLib/CtrlLib.h>
using namespace Upp;

class S {
	void Set(Size& sz, int x, int y, int z, int x1, int y1, int z1);

	const S& f(Rect& r, Rect& s) const;

	struct D {
		int s(int rc) const { return rc * 2; }

		int e(int rc) const { return rc * 1; }

		int w(int rc) const { return rc * 3; }

		int t() const { return 4; }

		int g(int k) const { return k; }

		void alloc();

		void alloc(int a);

		int v1;
		int v2;
	};
	D col, row;
};

void S::D::alloc() {}

static void func(int& x, int& y, int& x1, int& y1, int x2, int y2, int x3, int y3, int x4,
                 int y4)
{
}

const S& S::f(Rect& r, Rect& s) const
{
	int t, l, row_section_bottom, n;
	r.top = row.g(r.top);
	s.top = t != 0 && r.top < row.v1 ? row.v1 : r.top;
	r.left = col.g(r.left);
	s.left = l != 0 && r.left< col.v1 ? col.v1 : r.left;
	s.left = l != 0 && r.left < col.v1 ? col.v1 : r.left;
	r.bottom = row.g(r.bottom);
	s.bottom = row_section_bottom == 1  && r.bottom > row.v1 + row.v2 ?
	s.bottom =
		row_section_bottom == 1 && r.bottom > row.v1 + row.v2 ? row.v1 + row.v2 : r.bottom;
	r.right = col.g(r.right);
	s.right = n == 1  && r.right> col.v1 + col.v2 ?
	s.right = n == 1 && r.right > col.v1 + col.v2 ? col.v1 + col.v2 : r.right;
}


Line 46 (?), Line 48 ending (Wink, LIne 50 (?), Line 51 ending (Wink are highlighted by theide(libclang) to indicate grammer errors.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message icon14.gif
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message icon14.gif
Read Message
Read Message
Previous Topic: Win32 openssl updated to 3.2.1 version
Next Topic: SetRect "MegaRect" support...
Goto Forum:
  


Current Time: Sun Jun 08 17:10:03 CEST 2025

Total time taken to generate the page: 0.03786 seconds