Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(922)

Side by Side Diff: third_party/libxml/src/dict.c

Issue 1752223002: Roll libxml to 2.9.3 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re-cherry-pick fprintf formatting fix. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * dict.c: dictionary of reusable strings, just used to avoid allocation 2 * dict.c: dictionary of reusable strings, just used to avoid allocation
3 * and freeing operations. 3 * and freeing operations.
4 * 4 *
5 * Copyright (C) 2003-2012 Daniel Veillard. 5 * Copyright (C) 2003-2012 Daniel Veillard.
6 * 6 *
7 * Permission to use, copy, modify, and distribute this software for any 7 * Permission to use, copy, modify, and distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above 8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies. 9 * copyright notice and this permission notice appear in all copies.
10 * 10 *
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 const xmlChar *name, int len, int seed) 479 const xmlChar *name, int len, int seed)
480 { 480 {
481 unsigned long value = (unsigned long) seed; 481 unsigned long value = (unsigned long) seed;
482 482
483 if (plen == 0) 483 if (plen == 0)
484 value += 30 * (unsigned long) ':'; 484 value += 30 * (unsigned long) ':';
485 else 485 else
486 value += 30 * (*prefix); 486 value += 30 * (*prefix);
487 487
488 if (len > 10) { 488 if (len > 10) {
489 value += name[len - (plen + 1 + 1)]; 489 int offset = len - (plen + 1 + 1);
490 » if (offset < 0)
491 » offset = len - (10 + 1);
492 » value += name[offset];
490 len = 10; 493 len = 10;
491 if (plen > 10) 494 if (plen > 10)
492 plen = 10; 495 plen = 10;
493 } 496 }
494 switch (plen) { 497 switch (plen) {
495 case 10: value += prefix[9]; 498 case 10: value += prefix[9];
496 case 9: value += prefix[8]; 499 case 9: value += prefix[8];
497 case 8: value += prefix[7]; 500 case 8: value += prefix[7];
498 case 7: value += prefix[6]; 501 case 7: value += prefix[6];
499 case 6: value += prefix[5]; 502 case 6: value += prefix[5];
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after
1250 pool = dict->strings; 1253 pool = dict->strings;
1251 while (pool != NULL) { 1254 while (pool != NULL) {
1252 limit += pool->size; 1255 limit += pool->size;
1253 pool = pool->next; 1256 pool = pool->next;
1254 } 1257 }
1255 return(limit); 1258 return(limit);
1256 } 1259 }
1257 1260
1258 #define bottom_dict 1261 #define bottom_dict
1259 #include "elfgcchack.h" 1262 #include "elfgcchack.h"
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698