The purpose of this pull request is to bring parsers as close to uctags parsers as possible in terms of their interaction with the "main" part of ctags (this means, no changes in parser's actual logic are made in this patch set). This involves various renames of functions in the "API" of "main" so that Geany parsers call the same functions as the uctags ones. Additional modifications include using tab-only indentation style (some files used combination of tabs and spaces) and unification of includes with uctags so some stuff had to be moved around.
I was concentrated mostly on how the parsers look - in some cases I didn't backport the full implementation of the "main" functionality and used just some dummy implementation (in cases where the actual implementation isn't used by Geany).
At this point, parsers can be synced one by one independently of the sync work inside "main" (some are already identical with the uctags ones!). The work on syncing "main" shouldn't affect the work on syncing parsers (there are just tiny bits missing like cork support but these will be 1-line diffs in parsers).
It would be good to merge this soon - the patches have a huge potential to introduce merge conflicts with any other change made in the ctags directory and resolving conflicts will be quite painful.
You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/1160
-- Commit Summary --
* ctags: Remove unused Geany-specific tagEntryInfo fields * ctags: Remove useless Geany-specific tagEntryInfo::type field * ctags: Rename Geany-specific tagEntryInfo::arglist to upstream's ::signature * Make parser includes closer to uctags and sync parser license header * Move keywordTable definition to parse.h and use it for all parsers * Define ARRAY_SIZE() and use it instead of KIND_COUNT() * Use uctags implementation of keyword.c/h * Don't use combination of tabs and spaces for indentation * Add keywordTable to parserDefinition and use a common way to initialize keywords * Rename "mio" member of sInputFile to "fp" * Eliminate readNextChar() and pushBackChar() * Add separate "input" entry to sInputFile and use it * Rename fileGetc() to getcFromInputFile() * Rename fileUngetc() to ungetcToInputFile() * Rename fileSkipToCharacter() to skipToCharacterInInputFile() * Rename fileGetNthPrevC() to getNthPrevCFromInputFile() * Rename fileReadLine() to readLineFromInputFile() * Rename readLine() to readLineRaw() * Replace fileGetc() with getcFromInputFile() also in comments * Eliminate some trivial diffs in read.c * Rename tagEntryInfo.extensionFields.scope * Rename get.c/h to lcpp.c/h * Pass kind information into initTagEntry() * Use getInputLineNumber() instead of getSourceLineNumber() in parsers * Add parserNewFull() and use it for selected parsers * Add full xtag implementation and use it to check XTAG_QUALIFIED_TAGS * Add tagRegexTable to parserDefinition and use it to define regex parsers * Remove ctags.c and move its content to routines.c, main.c and options.c
-- File Changes --
M ctags/Makefile.am (12) M ctags/main/args.c (322) M ctags/main/args.h (40) D ctags/main/ctags.c (1397) M ctags/main/ctags.h (12) A ctags/main/debug.h (0) M ctags/main/entry.c (462) M ctags/main/entry.h (78) M ctags/main/general.h (123) M ctags/main/keyword.c (284) M ctags/main/keyword.h (15) A ctags/main/kind.h (27) R ctags/main/lcpp.c (134) R ctags/main/lcpp.h (11) M ctags/main/lregex.c (28) A ctags/main/main.c (277) M ctags/main/main.h (68) M ctags/main/nestlevel.c (2) M ctags/main/options.c (188) M ctags/main/options.h (114) M ctags/main/parse.c (877) M ctags/main/parse.h (86) M ctags/main/parsers.h (106) M ctags/main/read.c (866) M ctags/main/read.h (131) A ctags/main/routines.c (788) A ctags/main/routines.h (111) M ctags/main/sort.c (256) M ctags/main/sort.h (6) M ctags/main/strlist.c (4) M ctags/main/vstring.c (182) M ctags/main/vstring.h (46) A ctags/main/xtag.c (155) A ctags/main/xtag.h (55) M ctags/parsers/abaqus.c (5) M ctags/parsers/abc.c (9) M ctags/parsers/actionscript.c (62) M ctags/parsers/asciidoc.c (15) M ctags/parsers/asm.c (30) M ctags/parsers/basic.c (7) M ctags/parsers/c.c (96) M ctags/parsers/cobol.c (41) M ctags/parsers/conf.c (49) M ctags/parsers/css.c (43) M ctags/parsers/diff.c (9) M ctags/parsers/docbook.c (5) M ctags/parsers/erlang.c (16) M ctags/parsers/fortran.c (116) M ctags/parsers/go.c (80) M ctags/parsers/haskell.c (495) M ctags/parsers/haxe.c (327) M ctags/parsers/html.c (52) M ctags/parsers/jscript.c (106) M ctags/parsers/json.c (27) M ctags/parsers/latex.c (339) M ctags/parsers/lua.c (7) M ctags/parsers/make.c (20) M ctags/parsers/markdown.c (9) M ctags/parsers/matlab.c (33) M ctags/parsers/nsis.c (7) M ctags/parsers/objc.c (46) M ctags/parsers/pascal.c (510) M ctags/parsers/perl.c (23) M ctags/parsers/php.c (203) M ctags/parsers/powershell.c (55) M ctags/parsers/python.c (57) M ctags/parsers/r.c (295) M ctags/parsers/rest.c (15) M ctags/parsers/ruby.c (16) M ctags/parsers/rust.c (24) M ctags/parsers/sh.c (121) M ctags/parsers/sql.c (95) M ctags/parsers/tcl.c (7) M ctags/parsers/txt2tags.c (14) M ctags/parsers/verilog.c (36) M ctags/parsers/vhdl.c (257) M src/tagmanager/tm_ctags_wrappers.c (2) M src/tagmanager/tm_source_file.c (12)
-- Patch Links --
https://github.com/geany/geany/pull/1160.patch https://github.com/geany/geany/pull/1160.diff
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160
Has Travis fails.
IMHO this should be rejected as a single PR and made as a series of individual PRs commits that can be reasonably reviewed and committed individually. Like this its unreviewable IMO and will take ages to get committed.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160#issuecomment-237086876
IMHO this should be rejected as a single PR and made as a series of individual PRs commits that can be reasonably reviewed and committed individually. Like this its unreviewable IMO and will take ages to get committed.
I'll take a better look tomorrow, but if each commit is reviewable it should be fine.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160#issuecomment-237091900
@elextr This is a series of individual and mostly trivial commits which I tried to make as small as possible. The ones that create the biggest diff in terms of lines changed is
- whitespace formatting (converting tabs-and-spaces indentation to tabs-only indentation) - I could of course make this e.g. one commit per file but what would be the point of this? - reorganization that happened in ctags which removed stuff from ctags.c and moved it to various other files (it's impossible to split this one into multiple commits because once you start moving the code, you have to move all)
I'll check the travis problems (I'm at the airport now with crapy Internet connection).
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160#issuecomment-237192288
@techee pushed 1 commit.
9c4c113 Remove some additional functions from ctags which we don't need in Geany
--- You are receiving this because you are subscribed to this thread. View it on GitHub: https://github.com/geany/geany/pull/1160/files/ea72ecc00fc22f24eced3ffce7c7d...
I'll take a better look tomorrow, but if each commit is reviewable it should be fine.
I think the "Remove ctags.c and move its content to routines.c, main.c and options.c" is mostly unreviewable - it just moves too much code around. You'll have to trust me I didn't introduce any real diffs (except those mentioned in the commit).
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160#issuecomment-237196780
@techee pushed 2 commits.
7e0845b Make PathDelimiters match the declaration in header eb45c80 Always define ExecutableName variable
--- You are receiving this because you are subscribed to this thread. View it on GitHub: https://github.com/geany/geany/pull/1160/files/9c4c113488f6d5743c79865c74f2d...
whitespace formatting (converting tabs-and-spaces indentation to tabs-only indentation) - I could of course make this e.g. one commit per file but what would be the point of this?
There is no technical point, but there is a social point. The point would be to allow the changes to be easier for committers to review in small digestable chunks, without having to split the changeset themselves, they are doing it in their own time, don't try to take up their free time in a big chunk. The whitespace commits are exactly the sort of thing that can be done in independent chunks. If its a small chunk with only whitespace changes I can look at it and help @b4n, but if its a big lump I'm not going to take that much time out of the other things I'm doing.
reorganization that happened in ctags which removed stuff from ctags.c and moved it to various other files (it's impossible to split this one into multiple commits because once you start moving the code, you have to move all)
Thats fine, but that should be separate from whitespace changes.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160#issuecomment-237409673
There is no technical point, but there is a social point. The point would be to allow the changes to be easier for committers to review in small digestable chunks, without having to split the changeset themselves, they are doing it in their own time, don't try to take up their free time in a big chunk. The whitespace commits are exactly the sort of thing that can be done in independent chunks. If its a small chunk with only whitespace changes I can look at it and help @b4n, but if its a big lump I'm not going to take that much time out of the other things I'm doing.
There's no reason to spend much time on reviewing the whitespace stuff - all the files will eventually get replaced by the current uctags files. I think it would be possible to simply grab all uctags files and put them into Geany's ctags directory (and adjust to our needs) but since there have been something like 12 years of independent developments of both ctags versions I want to make sure I don't miss some of the Geany's patches of ctags so I'm doing it gradually.
Thats fine, but that should be separate from whitespace changes.
It is a separate commit but I couldn't make it a separate pull request at this time - it depends on the whitespace stuff and if I made two separate pull requests affecting the same lines it would lead to terrible merge conflicts (which I really don't want to resolve). But if it's the preferred way I can drop this patch for now and once/if the rest gets merged, open a new pull request for it.
By the way, the majority of the code the patches touch is a dead code in Geany - it's things like reading source files, creating ctags files, reading command-line parameters etc. which we don't use at all in Geany. So really no need to spend much time here.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160#issuecomment-237414504
There's no reason to spend much time on reviewing the whitespace stuff - all the files will eventually get replaced by the current uctags files.
So why bother at all? Don't make extra work for yourself and others :) Especially just for whitespace :) And if it causes conflicts with real changes, more reason to drop or delay the whitespace fixes.
I want to make sure I don't miss some of the Geany's patches of ctags so I'm doing it gradually.
Yes thats the right way.
One concern I have with this whole process is its gonna come to a screaming halt at `c.c` and not get completed, preventing us from getting most of the benefit of upstream compatibility. IIUC the geany version of `c.c` has several extra languages mixed into it. Maybe that should be looked at first.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160#issuecomment-237416180
I forgot to ask, why do we have dead code?
And why not do the whitespace changes file by file as you merge the ctags and Geany versions?
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160#issuecomment-237417540
So why bother at all? Don't make extra work for yourself and others :) Especially just for whitespace :) And if it causes conflicts with real changes, more reason to drop or delay the whitespace fixes.
You don't see the whole picture. My setup to do this work looks like this:
- one Geany window with project containing Geany - one Geany window with project containing ctags - one Meld window with geany/ctags/parsers vs ctags/parsers diff - one Meld window with geany/ctags/main vs ctags/main diff
and diffs are all over the place in Meld. I try to make some sense from the diffs and seeing 3700 lines less of diffs makes a huge difference for me. Also, if I didn't make the whitespace change now, every time I would copy/paste some code from uctags to Geany I would have to convert it into the old ctags indentation style if I want to have a consistent state after every commit (which I do).
The patches here don't make much sense by themselves, you'll only see the "why" part after you diff the result to uctags.
One concern I have with this whole process is its gonna come to a screaming halt at c.c and not get completed, preventing us from getting most of the benefit of upstream compatibility. IIUC the geany version of c.c has several extra languages mixed into it. Maybe that should be looked at first.
Right, c.c is the only file file that will probably not get merged (by me at least, this is the only file except the autotools stuff I fear in Geany - but @elextr, it sounds like a challenge for you :-). The thing is it's not c.c where the main development happens in uctags - it's the completely new c/c++ parser here:
https://github.com/universal-ctags/ctags/tree/master/parsers/cxx
So at some point we could switch to the new uctags parser for c/c++ and keep our c.c for the rest (my guts feeling is our c.c is better than the uctags one).
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160#issuecomment-237473355
I forgot to ask, why do we have dead code?
Because ctags isn't made to be a library - it's just a binary and we misuse it and use it in a library-like way. The result is that we use only some functions from some files while the rest is uninteresting for us.
In the future if I have time for this I'd like to add some real library support to uctags and there could be some ifdefs removing the dead code. But determining what is a dead code and what isn't is quite a lot of work and I don't want to do it in parallel with reducing the amount of changes between uctags and Geany.
And why not do the whitespace changes file by file as you merge the ctags and Geany versions?
Because you cannot do the merge file by file but rather something like diff group by diff group spanning multiple files. If file A uses stuff from file B and if I merge only file A independently, the result won't compile because of the missing change in B. And the dependencies are much worse than just A->B, it's more like A->B, A->C, A->D, B->A, D->A.
But the main purpose of this patch set is to get parsers exactly to this state where they can be merged file by file so everyone can grab his favorite language and merge it independently of the rest and shouldn't be affected by any additional changes in the "main" part of ctags.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160#issuecomment-237476778
I should also probably mention what I think should be the final result of all this:
- main part will be more or less identical to uctags with the exception of some modifications we need for Geany - except c.c parsers will be identical to uctags
We could have a patch file similar to Scintilla which introduces the changes we need in ctags and updating ctags would just mean copying "main" and "parsers" from uctags to Geany and applying the patch (except c.c which would still have to be updated manually if there's some affecting change in main).
Another thing I didn't mention is the commit in uctags against which I do the changes - it's
a3d8a6835b583d6a963aaf83f5c6fec4b95e6e54
and at the same time if I find something that should go from Geany to uctags, I make a commit on top of that (nothing too interesting for now, just some more or less formal things). I'll make a pull request for these changes in uctags at the end.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160#issuecomment-237479133
We could have a patch file similar to Scintilla which introduces the changes we need in ctags
Totally, and I support the end target of your changes, just not the process of getting there :smile:
I accidentally selected the "files changed" tab and it locked the browser for a time and used 1GB of memory +5328 line -5619 lines. IMNSHO its not a responsible thing to propose or to accept such a change. I greatly admire the quality of your submissions, but even you can't be sure whats in such a change, and poor @b4n really can't be expected to review it. There has got to be a better way, what about doing the whitespace first then? That will have no code changes and would be more reasonably reviewable and could even be a few files at a time.
my guts feeling is our c.c is better than the uctags one
Thats extremely disappointing since I think so much of ours that I turn off all uses of it but the symbols pane :smile:
(and the new uctags C/C++ one didn't seem to be much better when I tested, but presumably it will improve)
but @elextr, it sounds like a challenge for you :-)
I gave up self flagellation decades ago :smile:
And given your gut feeling above, no point anyway :frowning:
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160#issuecomment-237504880
@b4n I have a few questions. First, forgot to mention the patches at the beginning are yours from
https://github.com/b4n/geany/commits/ctags-tag-entry
I had to recreate them because of the new ctags location and added attribution in the comment. Hope it's fine with you.
Second, our ctags now uses these glib calls:
g_malloc g_free g_fopen g_try_malloc g_strv_length g_strerror g_realloc g_stat g_lstat g_warning
Is it OK to convert them to corresponding C stdlib or POSIX calls which uctags uses? My feeling is these were introduced as part of some "let's use glib calls everywhere in Geany" commit but we should keep ctags separate from Geany and have as little changes as possible compared to uctags. Is there any danger of mixing glib functions and their POSIX variants? (My guess is no as these seem to be just thin wrapper around the POSIX calls but I might be wrong.)
This leads me to another glib thing - GRegex. I know Nick introduced it to fix some prformance problem on Windows at that time (which might be gone by now) and personally I'd prefer to revert it back to GNU regex to avoid extra diffs to uctags. We now have just 3 regex parsers:
- HTML - Cobol - Actionscript - (R has an ifdef allowing it to switch between regex parser and hand-written parser but we don't use the regex part at the moment)
Cobol and Actionscript are "who cares" but HTML is definitely important and would badly deserve a hand-written parser because the regex parsers will always be too slow. For comparison, all *.hpp files from boost take 5s to parse; boost's HTML documentation takes 15s to parse. I think creating a super-simple hand-written HTML parser that does just the same as the regex parser shouldn't be that hard and would be worth it (I might do it in the future unless @elextr beats me ;-).
Yeah and finally the "merge soon" I mentioned was just relative to other patches affecting the ctags directory - it meant only "merge sooner than anything else in ctags" otherwise we get bad conflicts.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160#issuecomment-237510285
...poor @b4n really can't be expected to review it. There has got to be a better way, what about doing the whitespace first then? That will have no code changes and would be more reasonably reviewable and could even be a few files at a time.
Reviewing it through "Files changed" would be crazy and would indeed be unreviewable. But it can be easily reviewed patch by patch - if you simply click the whitespace patch above, you get
https://github.com/geany/geany/pull/1160/commits/6bc579798716dbe94a171a016f9...
which is quite obvious (well, the github diff implementation screws up from time to time and doesn't show the same lines next to each other but there are not so many of those). Reviewing the patches individually is the same as if I created several pull requests (which isn't easily doable because of the patch dependency as I explained).
So I hope our poor old @b4n won't suffer much :-).
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160#issuecomment-237513070
(and the new uctags C/C++ one didn't seem to be much better when I tested, but presumably it will improve)
If I understood correctly, it parses whole function bodies and you get e.g. type information of local variables. This would be really interesting for scope completion in Geany because right now Geany just doesn't know the type of a local variable and doesn't do any scope completion at all. (Also we should add some support in scope completion for inheritance so it shows also the inherited methods.)
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160#issuecomment-237517067
@techee changing `g_` to plain POSIX has the following problems I'm aware of:
1. Changing anything that returns memory back to Geany from `g_*` to `malloc` means the frees inside Geany need to be changed from `g_free()` to` free()` since you can't mix them (according to the Glib [description section](https://developer.gnome.org/glib/stable/glib-Memory-Allocation.html)) It is going to be confusing if some memory in geany needs to be `g_free`d and some plain `free`d. And I hope none of that gets to the plugin API.
2. `g_strerror()` is different to POSIX in that its guaranteed UTF-8 whereas POSIX is locale dependent. That means it needs conversion if its to be displayed in the UI. OT not *all* `g_` string [changes](https://github.com/geany/geany/commit/084c23bbb163fd95d00e2032698ec3371d3666...) were part of a global change :grin:
3. I believe `g_stat` etc work around much windows weirdness, which would have to be solved if the Glib version was not used. (BTW why don't these get #605 type problems?)
"HTML parser? I'm too busy generating the [expletive deleted] stuff" which is why I don't have much Geany time lately. Use the expat library.
IRO the new uctags parser: I understand it is intended to do local variables, but it didn't seem to provide them when I tried, and anyway what about scope for locals, and Geany does not understand scopes. It would be a real mess if all locals were offered for completions all the time.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160#issuecomment-237524652
So I hope our poor old @b4n won't suffer much
he only became old through reviewing patch sets from @techee and @kugel- :grinning:
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160#issuecomment-237525216
So I hope our poor old @b4n won't suffer much
he only became old through reviewing patch sets from @techee and @kugel- 😀
Very true. I take full responsibility for his grey hair :-)
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160#issuecomment-237533126
Changing anything that returns memory back to Geany from g_* to malloc means the frees inside Geany need to be changed from g_free() tofree() since you can't mix them (according to the Glib description section) It is going to be confusing if some memory in geany needs to be g_freed and some plain freed. And I hope none of that gets to the plugin API.
There are no frees of ctags values inside Geany - we copy the values from ctags tag entries and let ctags handle the memory management of its values. This shouldn't be a problem.
g_strerror() is different to POSIX in that its guaranteed UTF-8 whereas POSIX is locale dependent. That means it needs conversion if its to be displayed in the UI. OT not all g_ string changes were part of a global change 😁
This is in an error reporting function and from what I could see the new uctags code allows registering custom reporting function which we should do. So this shouldn't be a problem either.
I believe g_stat etc work around much windows weirdness, which would have to be solved if the Glib version was not used. (BTW why don't these get #605 type problems?)
Those are coming from the dead code (for Geany) anyway so it doesn't matter much. And ctags supports Windows natively so I suppose they solve various platform-specific quirks anyway.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160#issuecomment-237534564
regarding whitespace changes: I didn't give it a shot yet, but normally Git should be very useful to review those. If they are only indentation changes, `git show -b` should show an empty diff. And oddly enough I'd trust Git :)
Regarding memory allocation variants: I don't care so long as as @elextr the deallocator matches (even though nowadays GLib's will always match libc's, it'd be poor design to mix them). But remember that GLib's abort on allocation failure, while libc's just return NULL. I think CTags has wrapper for that itself, but it's an important difference.
About regex, well… the problem is that we'd need a bundled version of GNU regex, and that would mean keeping it up to date. If you really wanna do that, maybe "just" write a tiny wrapper using GRegex in a compatible API? I'm kinda afraid of having to keep a copy of GNU regex -- and it's especially ironic when it's in the process of syncing another lib :)
Regarding the HTML parser, yeah a non-regex one would probably be better, and indeed fairly easy to write. UCTags has even added libxml-based parsers, so maybe it could use that if we didn't care about the dep (FWIW, we already indirectly link to libexpat).
That said, let's get to the meat of this.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160#issuecomment-237545634
@@ -17,6 +17,7 @@ #include "parse.h" #include "read.h" #include "vstring.h" +#include "routines.h"
shouldn't these have been in 7b9d0dd83ce0874593758a620a9b9a2d256503c1?
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/001c7f65e485a223530e23146604d...
@elextr @techee see, 6bc579798716dbe94a171a016f9989c92c4b67e2 was quicker to review than some previous patches 'cause `git show -b 6bc579798716dbe94a171a016f9989c92c4b67e2` was very straightforward :) (about 62 lines changes (vim settings), instead of about 7446)
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160#issuecomment-237549978
I don't like 3dd1fb4853952d8fd80963952a03299e9b2c8012, because it makes it less clear what the type of the field is. What about suggesting the inverse patch to UCTags?
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160#issuecomment-237551252
About regex, well… the problem is that we'd need a bundled version of GNU regex, and that would mean keeping it up to date. If you really wanna do that, maybe "just" write a tiny wrapper using GRegex in a compatible API? I'm kinda afraid of having to keep a copy of GNU regex -- and it's especially ironic when it's in the process of syncing another lib :)
I know ctags has a bundled GNU regex library but I think it only falls back to it when GNU regex isn't present in the system (the native windows msvc build I guess). But for Windows we use msys2 where I'd suspect it would be present and the Mac build uses jhbuild to build all typical linux dependencies so I think it's there too. So do we actually need to bundle GNU regex?
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160#issuecomment-237552119
I don't like 3dd1fb4, because it makes it less clear what the type of the field is. What about suggesting the inverse patch to UCTags?
Yep, can do that.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160#issuecomment-237552302
@@ -387,7 +387,7 @@ extern void makeTagEntry (const tagEntryInfo *const tag) { Assert (tag->name != NULL); if (tag->name [0] == '\0')
error (WARNING, "ignoring null tag in %s", vStringValue (File.name));
error (WARNING, "ignoring null tag in %s", getInputFileName ());
this changes which name is used. However, it does match UCTags
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/7ac17b662facd503d0c822cd61726...
@@ -387,7 +387,7 @@ extern void makeTagEntry (const tagEntryInfo *const tag) { Assert (tag->name != NULL); if (tag->name [0] == '\0')
error (WARNING, "ignoring null tag in %s", vStringValue (File.name));
error (WARNING, "ignoring null tag in %s", getInputFileName ());
hum no, it actually doesn't: it matches the call, but the implementation in UCTags is `return vStringValue (File.input.name);`, while ours (see below) is `vStringValue (File.source.name)`. I have no idea if it changes anything in practice, but it's not the same.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/7ac17b662facd503d0c822cd61726...
@@ -610,7 +611,7 @@ extern char *readSourceLine (vString *const vLine, MIOPos location, *pSeekValue = mio_tell (File.fp); result = readLine (vLine, File.fp); if (result == NULL)
error (FATAL, "Unexpected end of file: %s", vStringValue (File.name));
error (FATAL, "Unexpected end of file: %s", getInputFileName ());
ditto
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/7ac17b662facd503d0c822cd61726...
@@ -17,6 +17,7 @@ #include "parse.h" #include "read.h" #include "vstring.h" +#include "routines.h"
Yes but I didn't notice it at that point (abaqus isn't in uctags so I didn't see the diff). I'd prefer not having to manipulate the history because of this.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/001c7f65e485a223530e23146604d...
@@ -43,7 +43,7 @@ static kindOption ShKinds [] = { */ static boolean hackReject (const vString* const tagName) {
- const char *const scriptName = baseFilename (vStringValue (File.name));
- const char *const scriptName = baseFilename (getInputFileName ());
ditto
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/7ac17b662facd503d0c822cd61726...
@@ -17,6 +17,7 @@ #include "parse.h" #include "read.h" #include "vstring.h" +#include "routines.h"
nah doesn't matter
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/001c7f65e485a223530e23146604d...
mio_getpos (mio, &startOfLine);
startOfLine = mio_tell(fp);
how comes this is different in UCTags? But well, whatever, practically it's the same.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/bbbbb309baa0ff6a94f50437e99cc...
781738fe10153e808dbce08879618f1ce91d685f could ideally be merged in acdc44074fc79183c5813b1fad5ca2151cfd2d1b, but well, it might just be annoying for review. At least don't do it just now.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160#issuecomment-237558199
@elextr @techee see, 6bc5797 was quicker to review than some previous patches 'cause git show -b 6bc579798716dbe94a171a016f9989c92c4b67e2 was very straightforward :) (about 62 lines changes (vim settings), instead of about 7446)
I could have smuggled in some evil indents which you don't see this way :-P. In fact there are some indent diffs compared to uctags - Geany always replaces tabs with spaces but it replaces spaces with tabs only at the beginning of a line:
https://github.com/geany/geany/blob/master/src/editor.c#L4484 (based on the comment in the corresponding commit it's probably OK).
This means that e.g. between
``` some_code(); /* some comment */ ```
the whitespace used is incorrect. But the number of these is much smaller and these can get fixed on the way.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160#issuecomment-237558212
@@ -387,7 +387,7 @@ extern void makeTagEntry (const tagEntryInfo *const tag) { Assert (tag->name != NULL); if (tag->name [0] == '\0')
error (WARNING, "ignoring null tag in %s", vStringValue (File.name));
error (WARNING, "ignoring null tag in %s", getInputFileName ());
The difference is only when #line directives are used - the "input" value is without line directives processed (which we want because we want the lines in source files) while "source" is when the directives are taken into account. But I think this happens only when some command-line switch is enabled and if not, both are the same.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/7ac17b662facd503d0c822cd61726...
mio_getpos (mio, &startOfLine);
startOfLine = mio_tell(fp);
When I was adding MIO to uctags I found it easier to replace FILE with MIO and just follow the errors and fix them on the way (my way) than checking how it's done in Geany. So there are minor differences like that.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/bbbbb309baa0ff6a94f50437e99cc...
I could have smuggled in some evil indents which you don't see this way :-P
Well, yeah, but you didn't, did you? :) And well, now I also checked you didn't alter the content of any string. So as you only touched C files, and C is whitespace-agnostic, the worse you could have done is ugly misleading indentation. But well, reviewing *this* is very hard, and probably not important as I'm sure you didn't do that, and previous code had odd things already.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160#issuecomment-237563616
Well, yeah, but you didn't, did you? :)
And well, now I also checked you didn't alter the content of any string. So as you only touched C files, and C is whitespace-agnostic, the worse you could have done is ugly misleading indentation.
Right. That's why I added all the spyware code in https://github.com/geany/geany/pull/1160/commits/ea72ecc00fc22f24eced3ffce7c... :-)
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160#issuecomment-237565237
@@ -75,8 +75,8 @@ extern void makeSimpleScopedTag (const vString* const name,
e.kindName = kinds [kind].name; e.kind = kinds [kind].letter;
e.extensionFields.scope[0] = scope;
e.extensionFields.scope[1] = scope2;
e.extensionFields.scopeKind = &(kinds [kind]);
this looks wrong: it uses kind, and ignores `scopeKind`. Shouldn't it instead change `scopeKind` to an int and use that?
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/cb1c15483bce9e5bad735113ca2b1...
tag->extensionFields.signature = arglist; tag->extensionFields.varType = vartype;
}
- else
initTagEntry (tag, NULL);
I'm afraid it's not really possible to just not initialize the entry, is it?
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/359c60b81b8d80af4551f638b2b8c...
@@ -75,8 +75,8 @@ extern void makeSimpleScopedTag (const vString* const name,
e.kindName = kinds [kind].name; e.kind = kinds [kind].letter;
e.extensionFields.scope[0] = scope;
e.extensionFields.scope[1] = scope2;
e.extensionFields.scopeKind = &(kinds [kind]);
Eh, you're right. The whole function will be removed at the end anyway, we use it just for conf but yeah, this is wrong. Will fix.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/cb1c15483bce9e5bad735113ca2b1...
result->fileKind = &defaultFileKind;
- result->enabled = TRUE;
hum, how comes this gets added here?
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/781f4ef1caba2c0c3fbaa5dbc9481...
tag->extensionFields.signature = arglist; tag->extensionFields.varType = vartype;
}
- else
initTagEntry (tag, NULL);
Ah right, I somehow thought this was makeTagEntry() and was wondering why there's a tag created with a NULL name (and name is then later checked in makePascalTag() and based on that the tag is created or not). I'll use the code from uctags.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/359c60b81b8d80af4551f638b2b8c...
I'm at 8c0bfbb0f388124f601049301e2742bb1d7ccf1b, but I take a little break.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160#issuecomment-237576255
result->fileKind = &defaultFileKind;
- result->enabled = TRUE;
parserNewFull() looks this way in uctags:
https://github.com/universal-ctags/ctags/blob/master/main/parse.c#L163
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/781f4ef1caba2c0c3fbaa5dbc9481...
I'm at 8c0bfbb, but I take a little break.
Well deserved, quite a headache source isn't it?
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160#issuecomment-237577143
result->fileKind = &defaultFileKind;
- result->enabled = TRUE;
yeah I saw, but I'm wondering why it wasn't there before, and gets added here. but if it's only because our "main" code doesn't check whether the parser is enabled enough, it's fair enough.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/781f4ef1caba2c0c3fbaa5dbc9481...
Yeah totally, I'm trying to stop before my head explodes :]
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160#issuecomment-237577524
@@ -113,11 +107,11 @@ static void clearPatternSet (const langType language) { eFree (p->u.tag.name_pattern); p->u.tag.name_pattern = NULL;
eFree (p->u.tag.kind.name);
eFree ((char *)p->u.tag.kind.name);
it's not worse than [UCTags'](https://github.com/universal-ctags/ctags/blob/master/main/lregex.c#L316) despite what you say in the commit message.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/359c60b81b8d80af4551f638b2b8c...
+extern boolean isDestinationStdout (void) +{
- boolean toStdout = FALSE;
- if (Option.xref || Option.filter ||
(Option.tagFileName != NULL && (strcmp (Option.tagFileName, "-") == 0
|| strcmp (Option.tagFileName, "/dev/stdout") == 0
)))
toStdout = TRUE;
- return toStdout;
+}
+# if defined (WIN32)
+static boolean createTagsForMatchingEntries (char *const pattern)
this was #if0'd in ctags.c
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/d440a81166e62d41e2b06d555b471...
vStringCatS (filePath, entryName);
resize |= createTagsForEntry (vStringValue (filePath));
}
} while (_findnext (hFile, &fileInfo) == 0);
_findclose (hFile);
- }
+#endif
- vStringDelete (filePath);
- return resize;
+}
+#endif
+static boolean recurseIntoDirectory (const char *const dirName)
same
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/d440a81166e62d41e2b06d555b471...
- if (totalTags > 0 && Option.sorted)
- {
fprintf (errout, "%lu tag%s sorted", totalTags, plural (totalTags));
+#ifdef CLOCK_AVAILABLE
fprintf (errout, " in %.02f seconds",
((double) (timeStamps [2] - timeStamps [1])) / CLOCKS_PER_SEC);
+#endif
fputc ('\n', errout);
- }
+#ifdef TM_DEBUG
- fprintf (errout, "longest tag line = %lu\n",
(unsigned long) TagFile.max.line);
+#endif +}
actually, all 'til here
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/d440a81166e62d41e2b06d555b471...
+# endif +#endif
+#ifdef HAVE_DIRECT_H +# include <direct.h> /* to _getcwd */ +#endif +#ifdef HAVE_DIR_H +# include <dir.h> /* to declare findfirst() and findnext() */ +#endif +#ifdef HAVE_IO_H +# include <io.h> /* to declare open() */ +#endif +#include "debug.h" +#include "routines.h" +#ifdef HAVE_ICONV +# include "mbcs.h"
we better not define `HAVE_ICONV` then, because that include doesn't exist on our side
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/d440a81166e62d41e2b06d555b471...
+/* Hack for ridiculous practice of Microsoft Visual C++.
- */
+#if defined (WIN32) +# if defined (_MSC_VER) +# define stat _stat +# define getcwd _getcwd +# define PATH_MAX _MAX_PATH +# endif +#endif
+#ifndef PATH_MAX +# define PATH_MAX 256 +#endif
+#define selected(var,feature) (((int)(var) & (int)(feature)) == (int)feature)
should go below the *miscellaneous macros* comment below
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/d440a81166e62d41e2b06d555b471...
+# endif +#endif
+#ifdef HAVE_DIRECT_H +# include <direct.h> /* to _getcwd */ +#endif +#ifdef HAVE_DIR_H +# include <dir.h> /* to declare findfirst() and findnext() */ +#endif +#ifdef HAVE_IO_H +# include <io.h> /* to declare open() */ +#endif +#include "debug.h" +#include "routines.h" +#ifdef HAVE_ICONV +# include "mbcs.h"
more to the point, hopefully nothing needs iconv
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/d440a81166e62d41e2b06d555b471...
+# endif +#endif
+#ifdef HAVE_DIRECT_H +# include <direct.h> /* to _getcwd */ +#endif +#ifdef HAVE_DIR_H +# include <dir.h> /* to declare findfirst() and findnext() */ +#endif +#ifdef HAVE_IO_H +# include <io.h> /* to declare open() */ +#endif +#include "debug.h" +#include "routines.h" +#ifdef HAVE_ICONV +# include "mbcs.h"
well, if it's properly guarded like that it doesn't matter much
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/d440a81166e62d41e2b06d555b471...
+# endif +#endif
+#ifdef HAVE_DIRECT_H +# include <direct.h> /* to _getcwd */ +#endif +#ifdef HAVE_DIR_H +# include <dir.h> /* to declare findfirst() and findnext() */ +#endif +#ifdef HAVE_IO_H +# include <io.h> /* to declare open() */ +#endif +#include "debug.h" +#include "routines.h" +#ifdef HAVE_ICONV +# include "mbcs.h"
A better way to put it is, what do we lose if its not available? And if we lose nothing why is it needed?
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/d440a81166e62d41e2b06d555b471...
+# endif +#endif
+#ifdef HAVE_DIRECT_H +# include <direct.h> /* to _getcwd */ +#endif +#ifdef HAVE_DIR_H +# include <dir.h> /* to declare findfirst() and findnext() */ +#endif +#ifdef HAVE_IO_H +# include <io.h> /* to declare open() */ +#endif +#include "debug.h" +#include "routines.h" +#ifdef HAVE_ICONV +# include "mbcs.h"
Apparently it's the only usage of `HAVE_ICONV` in Geany apparently, the other haven't been imported from U-CTags.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/d440a81166e62d41e2b06d555b471...
+# endif +#endif
+#ifdef HAVE_DIRECT_H +# include <direct.h> /* to _getcwd */ +#endif +#ifdef HAVE_DIR_H +# include <dir.h> /* to declare findfirst() and findnext() */ +#endif +#ifdef HAVE_IO_H +# include <io.h> /* to declare open() */ +#endif +#include "debug.h" +#include "routines.h" +#ifdef HAVE_ICONV +# include "mbcs.h"
Ok.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/d440a81166e62d41e2b06d555b471...
+}
+extern boolean isDestinationStdout (void) +{
- boolean toStdout = FALSE;
- if (Option.xref || Option.filter ||
(Option.tagFileName != NULL && (strcmp (Option.tagFileName, "-") == 0
|| strcmp (Option.tagFileName, "/dev/stdout") == 0
)))
toStdout = TRUE;
- return toStdout;
+}
+# if defined (WIN32)
shouldn't probably have the space after the `#` as IIUC it's top level
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/d440a81166e62d41e2b06d555b471...
vStringCatS (filePath, entryName);
resize |= createTagsForEntry (vStringValue (filePath));
}
} while (_findnext (hFile, &fileInfo) == 0);
_findclose (hFile);
- }
+#endif
- vStringDelete (filePath);
- return resize;
+}
+#endif
+static boolean recurseIntoDirectory (const char *const dirName)
this was disabled
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/d440a81166e62d41e2b06d555b471...
+extern boolean isDestinationStdout (void) +{
- boolean toStdout = FALSE;
- if (Option.xref || Option.filter ||
(Option.tagFileName != NULL && (strcmp (Option.tagFileName, "-") == 0
|| strcmp (Option.tagFileName, "/dev/stdout") == 0
)))
toStdout = TRUE;
- return toStdout;
+}
+# if defined (WIN32)
+static boolean createTagsForMatchingEntries (char *const pattern)
was #if0'd
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/d440a81166e62d41e2b06d555b471...
+static const char *ExecutableName = "geany";
+/* +* FUNCTION PROTOTYPES +*/ +#ifdef NEED_PROTO_STAT +extern int stat (const char *, struct stat *); +#endif +#ifdef NEED_PROTO_LSTAT +extern int lstat (const char *, struct stat *); +#endif
+#if 0 +static boolean createTagsForEntry (const char *const entryName); +#endif
this has nothing to do here I'd say, as it's defined nowhere
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/d440a81166e62d41e2b06d555b471...
strcpy (CurrentDirectory, cwd);
- else
sprintf (CurrentDirectory, "%s%c", cwd, OUTPUT_PATH_SEPARATOR);
- free (cwd);
+} +#endif
+extern boolean doesFileExist (const char *const fileName) +{
- GStatBuf fileStatus;
- return (boolean) (g_stat (fileName, &fileStatus) == 0);
+}
+extern boolean isRecursiveLink (const char* const dirName)
this was #if0'd, and the impl in UCTags is different (but this one matches the old one we had, so I guess it's expected)
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/d440a81166e62d41e2b06d555b471...
+/* Return a newly-allocated string whose contents concatenate those of
- s1, s2, s3.
- Routine adapted from Gnu etags.
- */
+static char* concat (const char *s1, const char *s2, const char *s3) +{
- int len1 = strlen (s1), len2 = strlen (s2), len3 = strlen (s3);
- char *result = xMalloc (len1 + len2 + len3 + 1, char);
- strcpy (result, s1);
- strcpy (result + len1, s2);
- strcpy (result + len1 + len2, s3);
- result [len1 + len2 + len3] = '\0';
- return result;
indentation's wrong (funnily enough, it was correct in the original :wink: )
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/d440a81166e62d41e2b06d555b471...
+# else +# define PATH_SEPARATOR '/' +# endif +#endif
+#if defined (MSDOS_STYLE_PATH) && defined (UNIX_PATH_SEPARATOR) +# define OUTPUT_PATH_SEPARATOR '/' +#else +# define OUTPUT_PATH_SEPARATOR PATH_SEPARATOR +#endif
+/* +* DATA DECLARATIONS +*/ +#if defined (MSDOS_STYLE_PATH) +extern const char *const PathDelimiters;
that's not the same as in the impl, and the impl is `static`, which is a bit contradictory ^^
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/d440a81166e62d41e2b06d555b471...
@@ -160,7 +160,7 @@
- DATA DEFINITIONS
*/ #if defined (MSDOS_STYLE_PATH) -static const char PathDelimiters [] = ":/\"; +const char *const PathDelimiters = ":/\";
ah, better :)
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/9c4c113488f6d5743c79865c74f2d...
Okay, I think I'm done for now :)
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160#issuecomment-237997281
+# else +# define PATH_SEPARATOR '/' +# endif +#endif
+#if defined (MSDOS_STYLE_PATH) && defined (UNIX_PATH_SEPARATOR) +# define OUTPUT_PATH_SEPARATOR '/' +#else +# define OUTPUT_PATH_SEPARATOR PATH_SEPARATOR +#endif
+/* +* DATA DECLARATIONS +*/ +#if defined (MSDOS_STYLE_PATH) +extern const char *const PathDelimiters;
ah, it's fixed in 7e0845b083e56f59b87390507df9444c4f99b826 (on which my comment somehow shows as outdated, but I don't get why)
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/d440a81166e62d41e2b06d555b471...
vStringCatS (filePath, entryName);
resize |= createTagsForEntry (vStringValue (filePath));
}
} while (_findnext (hFile, &fileInfo) == 0);
_findclose (hFile);
- }
+#endif
- vStringDelete (filePath);
- return resize;
+}
+#endif
+static boolean recurseIntoDirectory (const char *const dirName)
Should I #if0 it or keep it the way it is? There will always be some dead code and the few lines here won't help much I think.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/d440a81166e62d41e2b06d555b471...
+}
+extern boolean isDestinationStdout (void) +{
- boolean toStdout = FALSE;
- if (Option.xref || Option.filter ||
(Option.tagFileName != NULL && (strcmp (Option.tagFileName, "-") == 0
|| strcmp (Option.tagFileName, "/dev/stdout") == 0
)))
toStdout = TRUE;
- return toStdout;
+}
+# if defined (WIN32)
The whole function together with the ifdef got removed in a subsequent commit.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/d440a81166e62d41e2b06d555b471...
+static const char *ExecutableName = "geany";
+/* +* FUNCTION PROTOTYPES +*/ +#ifdef NEED_PROTO_STAT +extern int stat (const char *, struct stat *); +#endif +#ifdef NEED_PROTO_LSTAT +extern int lstat (const char *, struct stat *); +#endif
+#if 0 +static boolean createTagsForEntry (const char *const entryName); +#endif
This one got removed too.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/d440a81166e62d41e2b06d555b471...
+/* Return a newly-allocated string whose contents concatenate those of
- s1, s2, s3.
- Routine adapted from Gnu etags.
- */
+static char* concat (const char *s1, const char *s2, const char *s3) +{
- int len1 = strlen (s1), len2 = strlen (s2), len3 = strlen (s3);
- char *result = xMalloc (len1 + len2 + len3 + 1, char);
- strcpy (result, s1);
- strcpy (result + len1, s2);
- strcpy (result + len1 + len2, s3);
- result [len1 + len2 + len3] = '\0';
- return result;
yeah, this is the indentation used in uctags - will fix in both
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/d440a81166e62d41e2b06d555b471...
+# else +# define PATH_SEPARATOR '/' +# endif +#endif
+#if defined (MSDOS_STYLE_PATH) && defined (UNIX_PATH_SEPARATOR) +# define OUTPUT_PATH_SEPARATOR '/' +#else +# define OUTPUT_PATH_SEPARATOR PATH_SEPARATOR +#endif
+/* +* DATA DECLARATIONS +*/ +#if defined (MSDOS_STYLE_PATH) +extern const char *const PathDelimiters;
In Geany it was static and in uctags it's extern. Apparently I kept the static from Geany in the impl and took uctags for the header and this was the result.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/d440a81166e62d41e2b06d555b471...
@techee pushed 23 commits.
530f475 Revert "Rename "mio" member of sInputFile to "fp"" 0ec3590 Remove makeSimpleScopedTag() and fix scope for conf filetype 0650707 Fix pascal tag initizalization 026da60 Move selected() under Miscellaneous macros 11dcc5e Fix indentation 9745d47 Sync whitespace in parsers 082a972 Use ARRAY_SIZE() in parsers 7bd81ab Change isLanguage() to isInputLanguage() 2161b73 Change isHeaderFile() to isInputHeaderFile() 76818f9 Change getSourceFileName() to getInputFileName() 2671d73 Use skipToCharacterInInputFile() in all parsers 1d48599 Remove R regex parser 95f9462 Rename isident() to cppIsident() 88a8724 Rename isident1() to cppIsident1() 2638899 Rename isBraceFormat to cppIsBraceFormat() 4910e25 Rename getDirectiveNestLevel() to cppGetDirectiveNestLevel() d122229 Rename skipOverCComment() to cppSkipOverCComment() 20ad9ad Make getArglistFromStr() static a59f82e Rename getArglistFromFilePos() to cppGetArglistFromFilePos() to match the rest 25c1d22 objc: Remove unnecessary redefinition of UNUSED 02138f9 Rename TM_DEBUG macro to DEBUG 967b572 Rename MIO variables from fp to mio ca65fa2 Sync whitespace and comments in main
--- You are receiving this because you are subscribed to this thread. View it on GitHub: https://github.com/geany/geany/pull/1160/files/eb45c80058bc74fb3331e91d78d41...
Okay, I think I'm done for now :)
Fear not, I'll keep you saturated :-).
I committed fixes for the various issues (hopefully all that matter). In addition, I tried to sync some more trivial stuff from parsers so there's some whitespace sync in parsers, some more function renames and similar.
I also pushed my changes to uctags here
https://github.com/techee/ctags/tree/geany_sync
where I'll be adding things that should go from Geany to ctags. When diffing it's best to compare to this branch to see less diffs.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160#issuecomment-238093461
@@ -2234,12 +2232,12 @@ static boolean skipPostArgumentStuff (statementInfo *const st, { switch (c) {
case ')': break;
case ':': skipMemIntializerList (token);break; /* ctor-initializer */
case '[': skipToMatch ("[]"); break;
case '=': cppUngetc (c); end = TRUE; break;
case '{': cppUngetc (c); end = TRUE; break;
case '}': cppUngetc (c); end = TRUE; break;
case ')': break;
case ':': skipMemIntializerList (token);break; /* ctor-initializer */
case '[': skipToMatch ("[]"); break;
case '=': cppUngetc (c); end = TRUE; break;
case '{': cppUngetc (c); end = TRUE; break;
case '}': cppUngetc (c); end = TRUE; break;
that one looks odd, but well.
though, I highly doubt we'll merge *c.c* from U-CTags, as we have *different* things in it, and that they have another C++ one anyway. I'll probably try to extract the Vala part to a separate parser (I already started a while back IIRC, experimenting with other stuff in the way), and we'll "only" be left with like 3 parsers in there, that have probably diverged a lot less. Though OTOH maybe yeah, when it's down to C#/Java/Vera/D it might start and be mergable.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/11dcc5e3e5a0014905fbb76457b52...
@techee pushed 1 commit.
e866a97 entry: Move functions around a bit to reduce the amount of diffs
--- You are receiving this because you are subscribed to this thread. View it on GitHub: https://github.com/geany/geany/pull/1160/files/ca65fa22367042ea8c88efab7e76d...
@@ -366,8 +366,8 @@ extern void openTagFile (void) static int replacementTruncate (const char *const name, const long size) { char *tempName = NULL;
- FILE *fp = tempFile ("w", &tempName);
- fclose (fp);
- MIO *mio = tempFile ("w", &tempName);
- fclose (mio);
that looks awfully wrong :)
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/02138f9e59cc5d57b3db617561d00...
@@ -365,8 +365,8 @@ static void fileNewline (void) File.newLine = FALSE; File.input.lineNumber++; File.source.lineNumber++;
- DebugStatement ( if (Option.breakLine == File.lineNumber) lineBreak (); )
- DebugStatement ( debugPrintf (DEBUG_RAW, "%6ld: ", File.lineNumber); )
- DebugStatement ( if (Option.breakLine == File.input.lineNumber) lineBreak (); )
- DebugStatement ( debugPrintf (DEBUG_RAW, "%6ld: ", File.input.lineNumber); )
doesn't seem to fit the commit's description, but otherwise OK
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/967b572240513689fc2f6f9aefa92...
reviewed and commented up to e866a976c960fe4d2a6150c3980ff278b21ed8b2
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160#issuecomment-238377844
@@ -2234,12 +2232,12 @@ static boolean skipPostArgumentStuff (statementInfo *const st, { switch (c) {
case ')': break;
case ':': skipMemIntializerList (token);break; /* ctor-initializer */
case '[': skipToMatch ("[]"); break;
case '=': cppUngetc (c); end = TRUE; break;
case '{': cppUngetc (c); end = TRUE; break;
case '}': cppUngetc (c); end = TRUE; break;
case ')': break;
case ':': skipMemIntializerList (token);break; /* ctor-initializer */
case '[': skipToMatch ("[]"); break;
case '=': cppUngetc (c); end = TRUE; break;
case '{': cppUngetc (c); end = TRUE; break;
case '}': cppUngetc (c); end = TRUE; break;
that one looks odd, but well.
Yeah, I should have probably fixed the indentation in uctags but it's not that important.
though, I highly doubt we'll merge c.c from U-CTags, as we have different things in it, and that they have another C++ one anyway. I'll probably try to extract the Vala part to a separate parser (I already started a while back IIRC, experimenting with other stuff in the way), and we'll "only" be left with like 3 parsers in there, that have probably diverged a lot less.
Though OTOH maybe yeah, when it's down to C#/Java/Vera/D it might start and be mergable.
Would it be too hard to do it the other way round and add Vala to uctag's c.c so it supports the same set of languages? I also think our function parameter recording works better than the uctags one so it might be worth porting too.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/11dcc5e3e5a0014905fbb76457b52...
vStringCatS (filePath, entryName);
resize |= createTagsForEntry (vStringValue (filePath));
}
} while (_findnext (hFile, &fileInfo) == 0);
_findclose (hFile);
- }
+#endif
- vStringDelete (filePath);
- return resize;
+}
+#endif
+static boolean recurseIntoDirectory (const char *const dirName)
doesn't really matter if it's in U-CTags. Just don't "introduce" API not there by un-commenting it, better just drop it.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/d440a81166e62d41e2b06d555b471...
vStringCatS (filePath, entryName);
resize |= createTagsForEntry (vStringValue (filePath));
}
} while (_findnext (hFile, &fileInfo) == 0);
_findclose (hFile);
- }
+#endif
- vStringDelete (filePath);
- return resize;
+}
+#endif
+static boolean recurseIntoDirectory (const char *const dirName)
(well, even: if it's in UCTags, better keep it the closest, so not #if0ing it)
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/d440a81166e62d41e2b06d555b471...
+# endif +#endif
+#ifdef HAVE_DIRECT_H +# include <direct.h> /* to _getcwd */ +#endif +#ifdef HAVE_DIR_H +# include <dir.h> /* to declare findfirst() and findnext() */ +#endif +#ifdef HAVE_IO_H +# include <io.h> /* to declare open() */ +#endif +#include "debug.h" +#include "routines.h" +#ifdef HAVE_ICONV +# include "mbcs.h"
@techee opinion on this? if a user has `-DHAVE_ICONV` in his `C[PP]FLAGS`, this will break to his face, even if iconv is actually correctly present. Sure there is no reason for such a flag to appear, but well.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/d440a81166e62d41e2b06d555b471...
@@ -366,8 +366,8 @@ extern void openTagFile (void) static int replacementTruncate (const char *const name, const long size) { char *tempName = NULL;
- FILE *fp = tempFile ("w", &tempName);
- fclose (fp);
- MIO *mio = tempFile ("w", &tempName);
- fclose (mio);
Wow, I have managed to screw this up both for uctags and Geany :-(
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/02138f9e59cc5d57b3db617561d00...
@techee yep, apparently all relevant comments are fixed, except for a decision on the iconv thing.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160#issuecomment-238380055
@@ -2234,12 +2232,12 @@ static boolean skipPostArgumentStuff (statementInfo *const st, { switch (c) {
case ')': break;
case ':': skipMemIntializerList (token);break; /* ctor-initializer */
case '[': skipToMatch ("[]"); break;
case '=': cppUngetc (c); end = TRUE; break;
case '{': cppUngetc (c); end = TRUE; break;
case '}': cppUngetc (c); end = TRUE; break;
case ')': break;
case ':': skipMemIntializerList (token);break; /* ctor-initializer */
case '[': skipToMatch ("[]"); break;
case '=': cppUngetc (c); end = TRUE; break;
case '{': cppUngetc (c); end = TRUE; break;
case '}': cppUngetc (c); end = TRUE; break;
Would it be too hard to do it the other way round and add Vala to uctag's c.c so it supports the same set of languages?
Well, the Vala support in *c.c* has known issues and hacks, so I'm not sure it'd be better to add it in uctags than splitting it up in Geany and add the split version in uctags.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/11dcc5e3e5a0014905fbb76457b52...
@@ -2234,12 +2232,12 @@ static boolean skipPostArgumentStuff (statementInfo *const st, { switch (c) {
case ')': break;
case ':': skipMemIntializerList (token);break; /* ctor-initializer */
case '[': skipToMatch ("[]"); break;
case '=': cppUngetc (c); end = TRUE; break;
case '{': cppUngetc (c); end = TRUE; break;
case '}': cppUngetc (c); end = TRUE; break;
case ')': break;
case ':': skipMemIntializerList (token);break; /* ctor-initializer */
case '[': skipToMatch ("[]"); break;
case '=': cppUngetc (c); end = TRUE; break;
case '{': cppUngetc (c); end = TRUE; break;
case '}': cppUngetc (c); end = TRUE; break;
I see, makes sense then.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/11dcc5e3e5a0014905fbb76457b52...
+# endif +#endif
+#ifdef HAVE_DIRECT_H +# include <direct.h> /* to _getcwd */ +#endif +#ifdef HAVE_DIR_H +# include <dir.h> /* to declare findfirst() and findnext() */ +#endif +#ifdef HAVE_IO_H +# include <io.h> /* to declare open() */ +#endif +#include "debug.h" +#include "routines.h" +#ifdef HAVE_ICONV +# include "mbcs.h"
I don't know how realistic it is that HAVE_ICONV will be present but we can add something like
``` #ifdef HAVE_ICONV # undef HAVE_ICONV #endif ```
to general.h to be sure. What do you think?
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/d440a81166e62d41e2b06d555b471...
@techee pushed 1 commit.
dad9f88 Fix incorrect mio closing
--- You are receiving this because you are subscribed to this thread. View it on GitHub: https://github.com/geany/geany/pull/1160/files/e866a976c960fe4d2a6150c3980ff...
Apart from possible fixes I don't plan much more for this pull request. Once it is merged, I'll start working on some more "main" syncs. I'll probably first create a pull request with the "easy" things which is about everything except parse.c and lregex.c which I'll leave at the very end in a separate pull request.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160#issuecomment-238390939
+# endif +#endif
+#ifdef HAVE_DIRECT_H +# include <direct.h> /* to _getcwd */ +#endif +#ifdef HAVE_DIR_H +# include <dir.h> /* to declare findfirst() and findnext() */ +#endif +#ifdef HAVE_IO_H +# include <io.h> /* to declare open() */ +#endif +#include "debug.h" +#include "routines.h" +#ifdef HAVE_ICONV +# include "mbcs.h"
In fact Geany's conifg.h will be used for ctags too - couldn't the above be added there?
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/d440a81166e62d41e2b06d555b471...
+# endif +#endif
+#ifdef HAVE_DIRECT_H +# include <direct.h> /* to _getcwd */ +#endif +#ifdef HAVE_DIR_H +# include <dir.h> /* to declare findfirst() and findnext() */ +#endif +#ifdef HAVE_IO_H +# include <io.h> /* to declare open() */ +#endif +#include "debug.h" +#include "routines.h" +#ifdef HAVE_ICONV +# include "mbcs.h"
Hum… is general.h not going to get merged? I mean, this is the current only use of this macro, and if this file isn't added an the macro not used in other synced code, I don't see why have this some place else than here.
But anyway, it probably doesn't matter much.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/d440a81166e62d41e2b06d555b471...
+# endif +#endif
+#ifdef HAVE_DIRECT_H +# include <direct.h> /* to _getcwd */ +#endif +#ifdef HAVE_DIR_H +# include <dir.h> /* to declare findfirst() and findnext() */ +#endif +#ifdef HAVE_IO_H +# include <io.h> /* to declare open() */ +#endif +#include "debug.h" +#include "routines.h" +#ifdef HAVE_ICONV +# include "mbcs.h"
In fact Geany's conifg.h will be used for ctags too - couldn't the above be added there?
I don't think it's trivially easy to add an explicit undef in config.h, is it? AFAIK the missing bits are just commented-out (and probably rightly so, as undefin a non-defined macro get some compilers to warn you about it)
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/d440a81166e62d41e2b06d555b471...
+# endif +#endif
+#ifdef HAVE_DIRECT_H +# include <direct.h> /* to _getcwd */ +#endif +#ifdef HAVE_DIR_H +# include <dir.h> /* to declare findfirst() and findnext() */ +#endif +#ifdef HAVE_IO_H +# include <io.h> /* to declare open() */ +#endif +#include "debug.h" +#include "routines.h" +#ifdef HAVE_ICONV +# include "mbcs.h"
Hum… is general.h not going to get merged? I mean, this is the current only use of this macro, and if this file isn't added an the macro not used in other synced code, I don't see why have this some place else than here.
We'll have some diffs against uctags e.g. to install our tag hook anyway so this could be one of the additional differences. In uctags #ifdef HAVE_ICONV is checked at quite many places so it's probably better to have it undefined once in general.h than having to do something at every place it appears.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/d440a81166e62d41e2b06d555b471...
+# endif +#endif
+#ifdef HAVE_DIRECT_H +# include <direct.h> /* to _getcwd */ +#endif +#ifdef HAVE_DIR_H +# include <dir.h> /* to declare findfirst() and findnext() */ +#endif +#ifdef HAVE_IO_H +# include <io.h> /* to declare open() */ +#endif +#include "debug.h" +#include "routines.h" +#ifdef HAVE_ICONV +# include "mbcs.h"
yeah then it probably makes sense. or we consider it doesn't matter and nobody will have fun defining it
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/d440a81166e62d41e2b06d555b471...
@@ -366,8 +366,8 @@ extern void openTagFile (void) static int replacementTruncate (const char *const name, const long size) { char *tempName = NULL;
- FILE *fp = tempFile ("w", &tempName);
- fclose (fp);
- MIO *mio = tempFile ("w", &tempName);
- fclose (mio);
Shouldn't the compiler freak-out on that?
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/02138f9e59cc5d57b3db617561d00...
@@ -366,8 +366,8 @@ extern void openTagFile (void) static int replacementTruncate (const char *const name, const long size) { char *tempName = NULL;
- FILE *fp = tempFile ("w", &tempName);
- fclose (fp);
- MIO *mio = tempFile ("w", &tempName);
- fclose (mio);
@codebrainz a little, but just because of incompatible pointer cast, nothing more
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/02138f9e59cc5d57b3db617561d00...
+# endif +#endif
+#ifdef HAVE_DIRECT_H +# include <direct.h> /* to _getcwd */ +#endif +#ifdef HAVE_DIR_H +# include <dir.h> /* to declare findfirst() and findnext() */ +#endif +#ifdef HAVE_IO_H +# include <io.h> /* to declare open() */ +#endif +#include "debug.h" +#include "routines.h" +#ifdef HAVE_ICONV +# include "mbcs.h"
IMO it shouldn't be defined unless someone does something really strange so we shouldn't need to do anything special. But I'll leave the decision up to you.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/d440a81166e62d41e2b06d555b471...
+# endif +#endif
+#ifdef HAVE_DIRECT_H +# include <direct.h> /* to _getcwd */ +#endif +#ifdef HAVE_DIR_H +# include <dir.h> /* to declare findfirst() and findnext() */ +#endif +#ifdef HAVE_IO_H +# include <io.h> /* to declare open() */ +#endif +#include "debug.h" +#include "routines.h" +#ifdef HAVE_ICONV +# include "mbcs.h"
yeah, for the moment don't bother about this, I indeed don't think it's valid to just define HAVE_ICONV and whine it breaks
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/d440a81166e62d41e2b06d555b471...
+# endif +#endif
+#ifdef HAVE_DIRECT_H +# include <direct.h> /* to _getcwd */ +#endif +#ifdef HAVE_DIR_H +# include <dir.h> /* to declare findfirst() and findnext() */ +#endif +#ifdef HAVE_IO_H +# include <io.h> /* to declare open() */ +#endif +#include "debug.h" +#include "routines.h" +#ifdef HAVE_ICONV +# include "mbcs.h"
I don't know how realistic it is that HAVE_ICONV will be present but we can add something like [...]
No need to do `#ifdef` first, it's perfectly legal to `#undef` a macro that isn't defined (C99 6.10.3.5).
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/d440a81166e62d41e2b06d555b471...
@@ -366,8 +366,8 @@ extern void openTagFile (void) static int replacementTruncate (const char *const name, const long size) { char *tempName = NULL;
- FILE *fp = tempFile ("w", &tempName);
- fclose (fp);
- MIO *mio = tempFile ("w", &tempName);
- fclose (mio);
In addition there are ifdefs around and it gets compiled only when truncate() or ftruncate() are missing on the system (Geany's config.h defines HAVE_FTRUNCATE).
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/02138f9e59cc5d57b3db617561d00...
+# endif +#endif
+#ifdef HAVE_DIRECT_H +# include <direct.h> /* to _getcwd */ +#endif +#ifdef HAVE_DIR_H +# include <dir.h> /* to declare findfirst() and findnext() */ +#endif +#ifdef HAVE_IO_H +# include <io.h> /* to declare open() */ +#endif +#include "debug.h" +#include "routines.h" +#ifdef HAVE_ICONV +# include "mbcs.h"
I indeed don't think it's valid to just define HAVE_ICONV and whine it breaks
Agree, since it appears to not be in public (TM) headers. If it was, I could imagine a plugin defining it if it used libiconv and causing trouble.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/d440a81166e62d41e2b06d555b471...
+# endif +#endif
+#ifdef HAVE_DIRECT_H +# include <direct.h> /* to _getcwd */ +#endif +#ifdef HAVE_DIR_H +# include <dir.h> /* to declare findfirst() and findnext() */ +#endif +#ifdef HAVE_IO_H +# include <io.h> /* to declare open() */ +#endif +#include "debug.h" +#include "routines.h" +#ifdef HAVE_ICONV +# include "mbcs.h"
yeah sure it'd be another deal if it was in a public header
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/d440a81166e62d41e2b06d555b471...
@@ -366,8 +366,8 @@ extern void openTagFile (void) static int replacementTruncate (const char *const name, const long size) { char *tempName = NULL;
- FILE *fp = tempFile ("w", &tempName);
- fclose (fp);
- MIO *mio = tempFile ("w", &tempName);
- fclose (mio);
Geany's config.h defines HAVE_FTRUNCATE
only if it's actually found on the system
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/02138f9e59cc5d57b3db617561d00...
@@ -366,8 +366,8 @@ extern void openTagFile (void) static int replacementTruncate (const char *const name, const long size) { char *tempName = NULL;
- FILE *fp = tempFile ("w", &tempName);
- fclose (fp);
- MIO *mio = tempFile ("w", &tempName);
- fclose (mio);
only if it's actually found on the system
Yeah, of course, I was just commenting the fact that I didn't see any warnings from the compiler because it didn't get compiled on my system.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160/files/02138f9e59cc5d57b3db617561d00...
@techee pushed 1 commit.
d0cc3dc Remove TagEntryFunction check in c.c
--- You are receiving this because you are subscribed to this thread. View it on GitHub: https://github.com/geany/geany/pull/1160/files/0eca258e58693ebdf0670b74e6934...
d0cc3dc OK
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1160#issuecomment-238856743
@techee pushed 1 commit.
a974f35 Define KEYWORD_NONE in keyword.h so it doesn't have to be defined by parsers
a974f35752558173a470df92fb505cabb395af2a OK
@techee pushed 1 commit.
b7f7ce2 Drop vi modelines
I've removed vi modelines as these have been dropped in the meantime by https://github.com/universal-ctags/ctags/commit/1f9cdae041442312d8953a2354c9...
b7f7ce267546d4e43511b613594daeb6e8051559 OK -- although U-CTags removed them because they added editorconfig config file IIUC.
@techee pushed 1 commit.
cb7da79 Add CTAGS_ATTR_ prefix to UNUSED() and PRINTF() macros
cb7da79824ccd023c495de37f047ae1441b45fd5 OK
@techee tell me when you think you're done adding too much stuff here, and it should be mergeable.
@b4n Done. (I was done something like 12 days ago, committed the few extra patches just because the pull request was still open and the patches made sense for it.)
@b4n Is there anything that prevents this getting merged? I'd like to continue syncing uctags and don't want it to diverge too much in the meantime.
``` ../../ctags/parsers/c.c: In function 'processToken': ../../ctags/parsers/c.c:2033:3: warning: case value '4294967295' not in enumerated type 'keywordId {aka enum eKeywordId}' [-Wswitch] case KEYWORD_NONE: processName (st); break; ^~~~ ``` How scared should we be? that's a typical signed/unsigned issue, but hum.
``` ../../ctags/main/lregex.c:656:13: warning: no previous prototype for 'printRegexKinds' [-Wmissing-prototypes] extern void printRegexKinds (const langType language CTAGS_ATTR_UNUSED, boolean indent CTAGS_ATTR_UNUSED) ^~~~~~~~~~~~~~~ ../../ctags/main/read.c:605:14: warning: no previous prototype for 'readLineFromBypass' [-Wmissing-prototypes] extern char *readLineFromBypass ( ^~~~~~~~~~~~~~~~~~ ``` Suggests unused or missing their header inclusion.
``` ../../ctags/main/main.c:125:13: warning: 'printTotals' defined but not used [-Wunused-function] static void printTotals (const clock_t *const timeStamps) ^~~~~~~~~~~ ``` No biggie either, but maybe worth noting.
Otherwise, should be mergeable indeed.
I'll have a look at the warnings and will try to port your uctags patch here.
@techee pushed 3 commits.
1e14667 Don't compare foreign values to enumeration type f511787 Add missing prototypes 63c054a #if 0 currently unused code to avoid compiler warning
@b4n Done.
Merged #1160.
Merged, thanks!
github-comments@lists.geany.org