build went through without compiler errors, but had to make some changes with guesses

2017-11-13 Thread Peter Kovacs

Hi all,

I am proudly did finish a build tonight.

However I did2 additional Code changes. I do not trust my choice. :P

Both changes targetet to make the compiler happy, and to make a best 
shot correctness.


But I do not understand what I changed, I probably did it wrong. :-D


1) packagepixeliterator.hxx line 611

Error:

const int remainder( x(d.x) % num_intraword_positions );

Explanaition: x is an int while d.x is also int because d is a 
vigra:Diff2D. The compiler wants to caculate something but interprets x 
as a functioncall thus fails.


Fix:

I gave the compiler a valid formula. I thought maybe t is a dif and we 
want to move. I decided at random for negative move. Probable positive 
(+) would be more wise. Now that I think of it.


But I realy dont know f it is the right way.

const int remainder( (x-d.x) % num_intraword_positions );


2)svptext.cxx in SvpGlyphPeer::RemovingGlyph

Error:

if( rGlyphData.ExtDataRef().mpData != Format::NONE ) -> c++ compile 
error: ISO C++ forbids comparison between pointer and integer 

Explanation: Format::NONE = 0, so I did not get the -fpermissive flag to 
work. So I looked at the code. An alternative that probable makes sense 
is to check at this point if something is at all in 
rGlyphData.ExtDataRef().mpData.
So instead of checking against Format::None I check now against NULL, 
Which the compiler accepted.


I will now try to find out what damage my guesses did. If you have any 
Idea how to check or any insight on where I changed code I am gratefull.



One last comment the code in both cases, I miss to see the beauty. I 
mean packagepiceliterator has the antipattern of Copy And Paste, while 
SvpGlyphPeer::RemovingGlyph tries to delete content from another class.
And that class looks generic, due to the void object I think rGlyphData 
itself does not know what it is storing.


I do not like both codeparts.

All the best
Peter


Re: Simpler Windows builds, oowintool, and Cygwin64

2017-11-13 Thread Damjan Jovanovic
Please test whether the attached patch helps?

Regards
Damjan

On Sat, Nov 11, 2017 at 8:02 PM, Matthias Seidel  wrote:

> Hi Damjan,
>
> Am 10.11.2017 um 06:27 schrieb Damjan Jovanovic:
> > Hi
> >
> > I've committed a few small small fixes to oowintool, mostly for JDK 8
> > detection and better logging, but I've confirmed that it already works
> > well, and --with-frame-home --with-psdk-home --with-midl-path
> > --with-jdk-home --with-csc-path and --with-cl-home options to ./configure
> > are all unnecessary.
> >
> > As for 64 bit Cygwin I believe the problem with oowintool is that it
> needs
> > to look under the Wow6432node subkey in the registry too, something that
> > should be easy to add. Is anyone available to test 64 bit Cygwin?
>
> I just installed Cygwin64 on Windows 10 and ./configure stops with:
>
> Can't find MS Visual Studio / VC++ at ./oowintool line 236.
> configure: error: oowintool failed to copy CRT
>
> Regards, Matthias
>
> >
> > Damjan
> >
>
>
>
Index: oowintool
===
--- oowintool	(revision 1815058)
+++ oowintool	(working copy)
@@ -217,6 +217,11 @@
 	$ver->{'product_dir'} = $install;
 	return $ver;
 	}
+	$install = reg_get_value ("HKEY_LOCAL_MACHINE/SOFTWARE/Wow6432Node" . $ver->{'key'});
+	if (defined $install && $install ne '') {
+	$ver->{'product_dir'} = $install;
+	return $ver;
+	}
 }
 die "Can't find MS Visual Studio / VC++";
 }
@@ -232,6 +237,11 @@
 	$ver->{'product_dir'} = $install;
 	return $ver;
 	}
+	$install = reg_get_value("HKEY_LOCAL_MACHINE/SOFTWARE/Wow6432Node" . $ver->{'key'});
+	if (defined $install && $install ne '') {
+	$ver->{'product_dir'} = $install;
+	return $ver;
+	}
 }
 die "Can't find MS Visual Studio / VC++";
 }

-
To unsubscribe, e-mail: dev-unsubscr...@openoffice.apache.org
For additional commands, e-mail: dev-h...@openoffice.apache.org