summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/graph.h
AgeCommit message (Collapse)AuthorFilesLines
2016-09-25Do not #define _RESERVED_IDENTIFIERSIvy Foster1-3/+3
Signed-off-by: Ivy Foster <ivy.foster@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2016-01-04Make alpm_graph state signedness explicitRikard Falkeborn1-1/+1
The signedness of char is implementation defined. Since the alpm_graph state is clearly meant to be signed, make the signedness explicit. This fixes bugs on systems where char is unsigned, in comparissons of the following type: if(v.state == -1) which, if state is unsigned, will never be true due to integer promotion rules. Fixes failing test/pacman/tests/sync012.py when compiling with -funsigned-char. Fixes two warnings [-Wtype-limits] for comparissons with -1 when compiling with -funsigned-char. Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2016-01-04Update copyright years for 2016Allan McRae1-1/+1
make update-copyright OLD=2015 NEW=2016 Signed-off-by: Allan McRae <allan@archlinux.org>
2015-02-01Update copyright notices for 2015Allan McRae1-1/+1
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-28Remove ts and sw from vim modeline when noet is setFlorian Pritz1-1/+1
Forcing vim users to view files with a tabstop of 2 seems really unnecessary when noet is set. I find it much easier to read code with ts=4 and I dislike having to override the modeline by hand. Command run: find . -type f -exec sed -i '/vim.* noet/s# ts=2 sw=2##' {} + Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-06Minor struct member reordering for packing concernsDan McGee1-2/+2
Noticed using clang and `-Wpadded`. Signed-off-by: Dan McGee <dan@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-06Update copyright years for 2014Allan McRae1-1/+1
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-03Update copyright year for 2013Allan McRae1-1/+1
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-02-20Update copyright yearsAllan McRae1-1/+1
Add 2012 to the copyright range for all libalpm and pacman source files. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-22include config.h via MakefilesDave Reisner1-2/+0
Ensures that config.h is always ordered correctly (first) in the includes. Also means that new source files get this for free without having to remember to add it. We opt for -imacros over -include as its more portable, and the added constraint by -imacros doesn't bother us for config.h. This also touches the HACKING file to remove the explicit mention of config.h as part of the includes. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-28Rename pmgraph_t to alpm_graph_tAllan McRae1-4/+4
Signed-off-by: Allan McRae <allan@archlinux.org>
2011-04-16Include "config.h" in header files using off_tDan McGee1-0/+2
This makes it absolutely dead easy to ensure off_t has the same length in all compilation units. I just spent 2.5 hours bashing my head on an issue related to this so damn it I'm fixing it for good. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-16Move graph.h functions into graph.cDan McGee1-20/+10
So we only need one copy in the final library, not one copy per time used. Ensure all necessary includes are in place (especially to get the right size of off_t each time it is compiled) by including "config.h" in the new graph.c. One small adjustment here makes the graph_free code more robust- ensure we don't have invalid pointers after each iteration by looking at the parents and children and adjusting accordingly. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-21Style change: return(x) --> return xDan McGee1-1/+1
This was discussed and more or less agreed upon on the mailing list. A huge checkin, but if we just do it and let people adjust the pain will end soon enough. Rebasing should be relatively straighforward for anyone that sees conflicts; just be sure you use the new return style if possible. The following semantic patch was used to do the change, along with some hand-massaging in order to preserve parenthesis where appropriate: The semantic match that finds this problem is as follows, although some hand-massaging was done in order to keep parenthesis where appropriate: (http://coccinelle.lip6.fr/) // <smpl> @@ expression a; @@ - return(a); + return a; // </smpl> A macros_file was also provided with the following content: Additional steps taken, mainly for ASSERT() macros: $ sed -i -e 's#return(NULL)#return NULL#' lib/libalpm/*.c $ sed -i -e 's#return(-1)#return -1#' lib/libalpm/*.c Signed-off-by: Dan McGee <dan@archlinux.org>
2011-02-15Use CALLOC for _alpm_graph_new()Pang Yan Han1-11/+2
Change _alpm_graph_new() to use CALLOC to avoid explicit zeroing out of fields in pmgraph_t. Signed-off-by: Pang Yan Han <pangyanhan@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-08Update copyright years for 2011Allan McRae1-1/+1
Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-15Bump copyright dates to 2010Dan McGee1-1/+1
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-07-01Update copyright headers and messagesDan McGee1-1/+2
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-04Use correct C type for file sizesDan McGee1-1/+3
We have been using unsigned long as a file size type for a while, which works but isn't quite correct and could easily break. Worse was probably our use of int in the download callback functions, which could be restrictive for packages > 2GB in size. Switch all file size variables to use off_t, which is the preferred type for file sizes. Note that at least on Linux, all applications compiled against libalpm must now be sure to use large file support, where _FILE_OFFSET_BITS is defined to be 64 or there will be some weird issues that crop up. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-26Completely rework delta algorithmChantry Xavier1-0/+1
Using the graph structures that Nagy set up for dependency sorting, we now do a similar process for deltas. Load up all of the deltas into a graph object on which we can then apply Dijkstra's algorithm, using the new weight field of graph struct. We initialize the nodes weight using the base files that we can use in our filecache (both filename and md5sum must match). The algorithm then picks the best path among those that can be resolved. Note that this algorithm has a few advantages over the old one: 1. It is completely file agnostic. These delta chains do not have to consist of package files- this could be adopted to do delta-fied DBs. 2. It does not use the local_db anymore, or even care if a package or file is currently installed. Instead, it only looks in the filecache for files and packages that match delta chain entries. Original-work-by: Dan McGee <dan@archlinux.org> Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-02-16Move pmgraph_t struct and functions to their own header fileDan McGee1-0/+55
This will allow us to utilize this helpful type and functions in places besides dependency calculations. In addition, remove the public declaration of pmgraph_t in alpm.h- there is zero need to expose this internal type. Signed-off-by: Dan McGee <dan@archlinux.org>