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

Side by Side Diff: site/dev/contrib/style.md

Issue 1032463002: Fix two typos in coding style (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 Coding Style Guidelines 1 Coding Style Guidelines
2 ======================= 2 =======================
3 3
4 These conventions have evolved over time. Some of the earlier code in both 4 These conventions have evolved over time. Some of the earlier code in both
5 projects doesn’t strictly adhere to the guidelines. However, as the code evolves 5 projects doesn’t strictly adhere to the guidelines. However, as the code evolves
6 we hope to make the existing code conform to the guildelines. 6 we hope to make the existing code conform to the guildelines.
7 7
8 Files 8 Files
9 ----- 9 -----
10 10
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 ... 369 ...
370 }; 370 };
371 ~~~~ 371 ~~~~
372 372
373 Method calls within method calls should be prefixed with dereference of the 373 Method calls within method calls should be prefixed with dereference of the
374 'this' pointer. For example: 374 'this' pointer. For example:
375 375
376 <!--?prettify?--> 376 <!--?prettify?-->
377 ~~~~ 377 ~~~~
378 this->method(); 378 this->method();
379 Memory Managemt 379 Memory Management
380 ~~~~ 380 ~~~~
381 381
382 All memory allocation should be routed through SkNEW and its variants. These are 382 All memory allocation should be routed through SkNEW and its variants. These are
383 #defined in SkPostConfig.h, but the correct way to get access to the config 383 #defined in SkPostConfig.h, but the correct way to get access to the config
384 system is to #include SkTypes.h, which will allow external users of the library 384 system is to #include SkTypes.h, which will allow external users of the library
385 to provide a custom memory manager or other adaptations. 385 to provide a custom memory manager or other adaptations.
386 386
387 <!--?prettify?--> 387 <!--?prettify?-->
388 ~~~~ 388 ~~~~
389 SkNEW(type_name) 389 SkNEW(type_name)
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 for packing or performance reasons. 449 for packing or performance reasons.
450 450
451 NULL, 0 451 NULL, 0
452 ------- 452 -------
453 453
454 Use NULL for pointers, 0 for ints. We prefer explicit NULL comparisons when 454 Use NULL for pointers, 0 for ints. We prefer explicit NULL comparisons when
455 checking for NULL pointers (as documentation): 455 checking for NULL pointers (as documentation):
456 456
457 <!--?prettify?--> 457 <!--?prettify?-->
458 ~~~~ 458 ~~~~
459 if (NULL == x) { // slightly preferred over if (x) 459 if (NULL == x) { // slightly preferred over if (!x)
460 ... 460 ...
461 } 461 }
462 ~~~~ 462 ~~~~
463 463
464 When checking non-NULL pointers explicit comparisons are not required because it 464 When checking non-NULL pointers explicit comparisons are not required because it
465 reads like a double negative: 465 reads like a double negative:
466 466
467 <!--?prettify?--> 467 <!--?prettify?-->
468 ~~~~ 468 ~~~~
469 if (x) { // slightly preferred over if (NULL != x) 469 if (x) { // slightly preferred over if (NULL != x)
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 this->drawBitmapRectToRect( 551 this->drawBitmapRectToRect(
552 bitmap, NULL, dst, paint, kNone_DrawBitmapRectFlag); 552 bitmap, NULL, dst, paint, kNone_DrawBitmapRectFlag);
553 } 553 }
554 ~~~~ 554 ~~~~
555 555
556 Python 556 Python
557 ------ 557 ------
558 558
559 Python code follows the [Google Python Style Guide](http://google-styleguide.goo glecode.com/svn/trunk/pyguide.html). 559 Python code follows the [Google Python Style Guide](http://google-styleguide.goo glecode.com/svn/trunk/pyguide.html).
560 560
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698