Android application to manipulate sd image from the site
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Ronald May (387) 407 posts |
The only thing I noticed the time I took RISC OS files to linux ADFS and back was a minor change in permissions, that didn’t have any affect in use anyway. I think it is fairly complete. Theo knows a bit about this. I compiled your last link to squach.c and got a lot of errors. Sometimes errors are cryptic and only happen because a prototype isn’t available.
We probably haven’t got s64 at a guess.
Clears that error (rightly or wrongly -haven’t investigated further) if((strlen(dst_filename)+4 < 256))seems to fix it |
h0bby1 (2567) 480 posts |
aaaa |
h0bby1 (2567) 480 posts |
aaaa |
Ronald May (387) 407 posts |
I read a bit of a book on secure C and C++ today. BSD strlcpy and strlncpy are pretty much equivalent of the _s ones. Unfortunately they are not part of !GCC. Probably macs have them. It sounds like the strncpy is buggy at placing the terminating 0 even in its designed capacity. |
h0bby1 (2567) 480 posts |
aaaaa |
h0bby1 (2567) 480 posts |
aaaa |
h0bby1 (2567) 480 posts |
aaaa |
h0bby1 (2567) 480 posts |
aaaa |
Chris Johnson (125) 825 posts |
I guess it means you have a lot of variables or functions that are not declared as static so the compiler expects them to be declared as extern in the corresponding source.h files. |
h0bby1 (2567) 480 posts |
aaaa |
h0bby1 (2567) 480 posts |
aaaa |
Chris Johnson (125) 825 posts |
I think the Norcroft amu tool etc will work with both RISC OS type file structures and unix/windows type. If you name your source files eg main/c and main/h, rather than having them named main in c and h directories, then if you transfer over the network, the file main/c will become main.c and so will be ok on other file systems. |
h0bby1 (2567) 480 posts |
aaaa |
Rick Murray (539) 13806 posts |
The “header biz” is exactly because you asked for it!
Obvious. You have a number of variables declared but are not used anywhere.
I think this means you have defined a function like lzw_dec_init() (with no parameter or void) so the compiler thinks you are using the ancient K&R way of declaring functions.
Somewhere you have if (meh = blah) when the C syntax means you probably meant if (meh == blah)… I have noticed that the RISC OS compiler is better at picking this up than some.
You may be doing something like meh = 1 << 28 and due to some painful and dumb rules, you may want to specify something like meh = 1ul << 28ul so the compiler is damn certain everything is an unsigned long.
You are trying to compare an unsigned value as “less than or equal to zero” which is technically impossible. Unsigned doesn’t swing negative.
Don’t know what your code is, but generally to can’t just do meh = &whatever, you need to cast it.
This possibly came from the previous error? If not, then you cannot use the array.subscript syntax for an indirected array pointer. Try the alternative array->subscript syntax.
As above, you can’t pass any old thing in and “hope it works” or the compiler will boot it out. You may need to cast. Also check you aren’t assigning a *string to a string[] or that sort of thing.
If you are pushing a large number (bit 31 set), you might have wanted unsigned int?
Clue in the message. ;-)
fopen argument one, that should be the filename, no? You may need casting if you want to use a malloc’d block of data as a string.
OMFG. I take pride in writing code (that may be utter poop) but compiles and links with zero messages.
Anything more than that is a Fail as far as I’m concerned. ;-) |
h0bby1 (2567) 480 posts |
aaaa |
Rick Murray (539) 13806 posts |
Probably1 needs a different one, but this isn’t a bad thing – you can use this to pull in the RISC OS specific stuff and help minimise the amount of #ifdef stuff scattered around the files. Example – when I did a command line program for DOS/RISC OS, I found that the simplest arrangement was to clone as much of conio.h and dos.h as I needed to display “nice” output and read the keyboard. In the DOS version of the program (built with TurboC++ so a rather custom setup there), it used the standard conio and dos. The MakeFile for the RISC OS side simply added in “roconio” and “rodos” which provided the expected functions. The only other change was a small #ifdef in the main header file that defined these functions in the absence of them under RISC OS. From there, the same code would then build on both platforms. 1 You might be able to get Make to do something with the alien makefile, but I think most people tend to prefer AMU in preference to Make. |
Steve Pampling (1551) 8155 posts |
“c.squach”, line 593: Warning: Old-style function ‘lzw_dec_init’ There are times I feel I’m starting to understand, and spotting a warning about old so called K&R function declarations is one such. The new style has advantages and this warning is one of them: “c.squach”, line 2097: Warning: Format requires 10 parameters, but 12 given and
I tend to work on the ideas that:
Maybe I’ve been in support too long but I regard errors and warnings as things that should not happen. |
h0bby1 (2567) 480 posts |
aaaa |
h0bby1 (2567) 480 posts |
aaaaaa |
h0bby1 (2567) 480 posts |
aaaa |
h0bby1 (2567) 480 posts |
aaaa |
Ronald May (387) 407 posts |
I didn’t know the norcroft compiler had an option to work with .c .h files. |
Chris Johnson (125) 825 posts |
Hmmm – maybe I have extrapolated too far. It will accept either form of source file path in , for example, includes, i.e. #include “main.h” or #include “h.main” both work. In some of my source files there are both types in the same source file. Bad practice, but resulted from copy/paste actions between source files. |
Ronald May (387) 407 posts |
OK so it /must/ have c directory and h directory. I can recall being confused a little by seeing ambiguity in the makefile.
|
h0bby1 (2567) 480 posts |
aaaaa |
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15