A yagura was offering protection for defenders, but at the same time was increasing the wall's resistance. Another technique to improve the walls, called in Japanese yokoya gakari, was to build them in zigzag, as in this photo taken at the Osaka castle.
EXIF info:
Nikon D300
Lens: 8-16mm F/4.5-5.6G
Focal Length: 10mm
Aperture: F/7.1
Shutter Speed: 1/1250s
ISO Sensitivity: ISO 200